.htaccess 重定向301不';我不能正常工作
我正在尝试执行301重定向,如下所示:.htaccess 重定向301不';我不能正常工作,.htaccess,redirect,.htaccess,Redirect,我正在尝试执行301重定向,如下所示: <ifmodule mod_rewrite.c> RewriteEngine On ##This is the redirect RewriteRule /page/old-url http://website.com/page/new-url [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(
<ifmodule mod_rewrite.c>
RewriteEngine On
##This is the redirect
RewriteRule /page/old-url http://website.com/page/new-url [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
</ifmodule>
http://website.com/page/new-url?route=page/old-url
RewriteEngine On
##This is the redirect
RewriteRule ^page/old-url/?$ /page/new-url/ [R=301,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
我尝试了许多变体,例如:
RedirectMatch 301 /page/old-url http://website.com/page/new-url
但仍然无法修复它
提前谢谢 让它像这样:
<ifmodule mod_rewrite.c>
RewriteEngine On
##This is the redirect
RewriteRule /page/old-url http://website.com/page/new-url [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
</ifmodule>
http://website.com/page/new-url?route=page/old-url
RewriteEngine On
##This is the redirect
RewriteRule ^page/old-url/?$ /page/new-url/ [R=301,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
在测试此更改之前,请确保清除浏览器缓存。我尝试过,但现在我得到了以下url:,它不会更改为在我的Apache上有效的新规则。确保这是在站点根目录中,并且在此之前没有其他规则