301 将旧域的几页重定向到新域
301 Redirect few pages of old domain to new domain
我只想使用 301 重定向将 3 个网址重定向到新域
example.com/about -> newdomain.com/about
example.com/test -> newdomain.com/test
有什么方法可以实现吗?
我试过 wordpress 插件,但它们允许相对域重定向
喜欢
newdomain.com/about -> newdomain.com/newabout
我认为可以使用 .htaccess 规则来完成,但我只找到了像这样重定向整个站点的规则
# BEGIN WordPress
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.oldsite.com RewriteRule (.*)
http://www.newsite.com/ [R=301,L]
# END WordPress
我不知道如何修改它以满足我的需要。
RewriteCond %{HTTP_HOST} ^(www.)?oldsite.com
RewriteRule ^/?(about|test)/?$ http://www.newsite.com/ [R=301,L]
我只想使用 301 重定向将 3 个网址重定向到新域
example.com/about -> newdomain.com/about
example.com/test -> newdomain.com/test
有什么方法可以实现吗? 我试过 wordpress 插件,但它们允许相对域重定向 喜欢
newdomain.com/about -> newdomain.com/newabout
我认为可以使用 .htaccess 规则来完成,但我只找到了像这样重定向整个站点的规则
# BEGIN WordPress
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.oldsite.com RewriteRule (.*)
http://www.newsite.com/ [R=301,L]
# END WordPress
我不知道如何修改它以满足我的需要。
RewriteCond %{HTTP_HOST} ^(www.)?oldsite.com
RewriteRule ^/?(about|test)/?$ http://www.newsite.com/ [R=301,L]