[英]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.