我有一个分期付款的博客网站。博客作者现在将开始为当地报纸发帖。基本上,我想要这个:
到目前为止我有这样的想法:
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。
发布于 2014-05-05 23:48:17
你可以有这样的规则:
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]
https://stackoverflow.com/questions/23375070
复制相似问题