2011-12-30 74 views
0
多頁

所以我的.htaccess文件看起來像這樣簡單的.htaccess 301重定向

RewriteBase/
Redirect 301 /page.html http://www.yoursite.com/newpage.html 
Redirect 301 /page2.html http://www.yoursite.com/newpage.html 

,它不重定向我page.html中

,如果我離開它

RewriteBase/
Redirect 301/http://www.yoursite.com/newpage.html 

它的工作原理,並重定向我的所有網站。現在爲什麼不工作,並相信我,我有page.html附近的.htaccess文件,而令人沮喪的是,我有類似10。html的重定向,而不是更多... :(

任何人都可以幫助我?

回答

4

要獲得相當的結果,你可以在任何其他規則添加到您的.haccess文件。

RewriteEngine On 
RewriteBase/

#redirect page or page2 .html 
RewriteRule ^page(|2)\.html$ http://www.yoursite.com/newpage.html [NC,R=301,L] 
+0

好的,謝謝,這個工作,但我不想正則表達式,只是線下其他一個如page2.html> newpath thepage1234.html> newpath – Master345 2011-12-30 21:51:32