我正在尝试重定向这个页面结构。
example.com/y/T5INF08ZEdA/Miranda-Kerr-In-Hot-Water-with-Orlando-Bloom
至
example.com/s/Miranda-Kerr-In-Hot-Water-with-Orlando-Bloom
我的访问权限是
RewriteRule ^s/(.*)$ index.php?videos=$1
RedirectMatch 301 ^/?y/(.*)$ http://www.example.com/s/$2 [R=301,L]但是,它重定向到
example.com/s/T5INF08ZEdA?videos=T5INF08ZEdA/Miranda-Kerr-In-Hot-Water-with-Orlando-Bloom
做这个重定向的正确方法是什么?
发布于 2013-08-14 22:58:41
您的RedirectMatch工作起来很奇怪,因为没有第二个捕获组($2应该是空的)。
试着只使用mod_rewrite,这两个指令可能相互干扰:
RewriteRule ^y/([^/]+)/(.*)$ /s/$2 [L,R=301]
RewriteRule ^s/(.*)$ index.php?videos=$1 [L]https://stackoverflow.com/questions/18242930
复制相似问题