![](/img/trans.png)
[英].htaccess - redirect domain.com and www.domain.com - to www.domain.com/en
[英].htaccess redirect permanent www.domain.com/A to www.domain.com/A/B
A是一個空文件夾,僅用於構建我的頁面層次結構。 它包含B,C,它們也是文件夾(非空)
層次結構來自Apostrophe CMS 。
以下規則在.htaccess中不起作用:
Redirect permanent /A http://www.domain.com/A/B
因為該規則以一遍又一遍的方式被調用,所以最終以: http : //www.domain.com/A/B/B/B/B等結尾。
誰能指出我的解決方案? 謝謝
嘗試使用RedirectMatch,並在正則表達式中包含“字符串結尾” $。
RedirectMatch permanent /A$ http://www.domain.com/A/B
RedirectMatch permanent /A/$ http://www.domain.com/A/B
編輯:以下比賽可能會更好一些(全部)
RedirectMatch permanent .*/A$ http://www.domain.com/A/B
RedirectMatch permanent .*/A/$ http://www.domain.com/A/B
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.