我最近移動了我的博客,我只是301重定向幾頁。麻煩是我發現了一個惱人的問題。301 .htaccess奇怪的行爲和完全匹配
有兩個環節 -
hxxp://www.domain.com/category/post.html
hxxp://www.domain.com/category/
我想301都到一個新的域,所以寫了下面......
Redirect 301 hxxp://www.domain.com/category/post.html hxxp://new.domain.com/category/post.html
這工作得很好,然後我做了類別...
Redirect 301 hxxp://www.domain.com/category/ hxxp://new.domain.com/
由於類別結構不同,我只是想301它的主頁。
問題是,這個重定向影響了第一次重定向,可能是因爲它與第一次重定向非常相似。
任何想法如何我只能301重定向精確匹配?
謝謝!
什麼是該命令你已經給出了規則。 – Balanivash
只要刪除'hxxp:// www.domain.com'部分,你就很好:'Redirect'指令的OLD_URL部分應該以斜槓開頭,不應該包含域名:http://httpd.apache.org/docs /current/mod/mod_alias.html#redirect – LazyOne