[英]simple .htaccess 301 redirect multiple pages
所以我的.htaccess文件看起來像這樣
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
它可以正常工作,並重定向我的所有網站。 現在為什么不起作用,相信我,我在.htaccess文件附近有page.html,而沮喪的是我有10個類似.html的東西要重定向,而不是更多... :(
誰能幫我?
要獲得等效的結果,可以將其添加到.haccess文件中,然后再執行其他任何規則。
RewriteEngine On
RewriteBase /
#redirect page or page2 .html
RewriteRule ^page(|2)\.html$ http://www.yoursite.com/newpage.html [NC,R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.