[英].htaccess Redirect all pages except one and another internal redirect of a certain domain
[英].htaccess: Redirect all pages to a new domain, except certain pages
我有一個安裝有Wordpress的博客網站。 博客作者現在將開始為當地報紙發帖。 基本上,我想要這樣:
到目前為止,我有這個:
RewriteEngine On
# Redirect specific articles
RewriteCond %{REQUEST_URI} article-slug-goes-here
RewriteRule .* http://www.newspaper.com/theblog/588433/article-slug-goes-here.html [R=301,L]
# Redirect all other stuff to the home
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule ^(.*)$ http://www.newspaper.com/theblog/ [R=301,L]
第一部分有效,而其他部分無效。 我應該能夠將其他文章添加到重定向列表中,以便將它們重定向到其相應的新URL。
您可以具有如下規則:
RewriteEngine On
# Redirect specific articles
RewriteRule ^(article1|article2|article3) http://www.newspaper.com/theblog/588433/article-slug-goes-here.html [R=301,L]
# Redirect all other stuff to the home
RewriteRule ^ http://www.newspaper.com/theblog/ [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.