[英]Need to redirect (301) just the exact URL : www.abc.com/wholesale but it's rewriting everything with “wholesale”
我需要重定向以下URL(批发后重定向其他URL路径):
www.jedzebel.com/wholesale (或jedzebel.com/wholesale)
到以下内容:
www.jedzebel.com/wholesale-info/wholesale-information.html
不幸的是,我已经有一个名为批发的文件夹,并且当使用标准301重定向时,mod_rewrite规则导致路径中带有批发的所有URL均被错误地重写。
在Joomla重写规则之后,我在RedirectMatch和.htaccess中的RedirectMatch中都尝试了以下操作,但是我一定有问题:
RedirectMatch (.*)/wholesale?$ http://www.jedzebel.com/wholesale-info/wholesale-information.html [R=301,L]
Redirect 301 ^wholesale?$ http://www.jedzebel.com/wholesale-info/wholesale-information.html
有任何想法吗 ? 我只需要重写www.jedzebel.com/wholesale ...
您可以在规则中将斜杠设为可选。
您可以尝试以下规则:
RedirectMatch 301 ^/wholesale/?$ /wholesale-info/wholesale-information.html
替代方案:
RewriteEngine On
RewriteRule ^wholesale/?$ /wholesale-info/wholesale-information.html [L,R=301,NC]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.