2011-12-30 66 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