【发布时间】:2020-02-14 05:33:27
【问题描述】:
我有子文件夹 opencart 网站
.php 不带 .php 的重定向
这是我需要移动的以下一些页面的示例,基本上页面文件夹中的任何内容都需要向下移动,而且旧页面总是在没有 php 的情况下重定向。
http://www.example.com/subfolder/login.php 到 http://www.example.com/subfolder/login
http://www.example.com/subfolder/register.php 到 http://www.example.com/subfolder/register
http://www.example.com/subfolder/account.php 到 http://www.example.com/subfolder/account
这是我的 htaccess :
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.
# 2. In your opencart directory rename htaccess.txt to .htaccess
# For any support issues please visit: http://www.opencart.com
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
# SEO URL Settings
RewriteEngine On
RewriteBase /subfolder/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
redirect 301 /login.php http://www.example.com/subfolder/login
我会尝试上面的代码。但没有任何工作正常
【问题讨论】:
-
你有哪个 opencart 版本?
-
opencart 3020 版本
标签: php .htaccess opencart subdirectory