[英].htaccess redirect from old site to new site
如何通過htaccess將舊鏈接重定向到新站點。 我有以下代碼:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.mysite.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R=301,L]
Redirect 301 /2013/08/ http://www.mysite.co.uk/whats-on/news/
附件正確嗎?
不要將mod_alias
規則與mod_rewrite
規則混合使用,並在通用重定向之前保留特定的重定向。
RewriteEngine on
RewriteRule ^2013/08/ http://www.mysite.co.uk/whats-on/news/ [L,R=301]
RewriteCond %{HTTP_HOST} !^(www\.)?mysite\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.mysite.co.uk/$1 [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.