.htaccess 301 RedirectMatch 到新频道
.htaccess 301 RedirectMatch to a new channel
我想从旧频道重定向到新频道。
来自
www.example.com/**oldchannel**/article/12345
至
www.example.com/**newchannel**/article/12345
谁能告诉我为什么这不起作用?
RedirectMatch 301 ^/oldchannel/$ /newchannel
应该是:
RewriteEngine On
RewriteBase /
RewriteRule ^oldchannel/(.*)$ /newchannel/ [L,NC,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url= [QSA,L]
需要从模式和反向引用中捕获值以用于 RHS 目标。
我想从旧频道重定向到新频道。
来自
www.example.com/**oldchannel**/article/12345
至
www.example.com/**newchannel**/article/12345
谁能告诉我为什么这不起作用?
RedirectMatch 301 ^/oldchannel/$ /newchannel
应该是:
RewriteEngine On
RewriteBase /
RewriteRule ^oldchannel/(.*)$ /newchannel/ [L,NC,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url= [QSA,L]
需要从模式和反向引用中捕获值以用于 RHS 目标。