[英].htaccess 301 redirect from one subdirectory to another and preserve folder/directory structure
[英]Htaccess 301 redirect from one directory to its subdirectory and keeping the main directory url accesible
我正在嘗試重定向下面的所有頁面
至
以及如何使目錄url可訪問,因為該目錄url還包含我需要顯示的內容,並且我使用了此htaccess代碼
RewriteRule ^/directory/(.*)$ /directory/supplier/$1 [L,R=301,NC]
但它不起作用。
從重寫模式中刪除前導斜杠,就可以了
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/directory/supplier/
RewriteRule ^directory/(.+)$ /directory/supplier/$1 [L,R=301,NC]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.