![](/img/trans.png)
[英].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.