我有一个带有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。
答案 0 :(得分:1)
您可以遵守以下规则:
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]