开发者

Redirect old Wordpress Posts to new URL

开发者 https://www.devze.com 2023-01-12 15:37 出处:网络
I am assuming I have to use .htaccess, but what do i do to tell my oldsite http://oldsite.com/post-slug to redirect any \"post-开发者_如何学编程slug\" to http://newsite.com/post-slug automatically.On

I am assuming I have to use .htaccess, but what do i do to tell my oldsite http://oldsite.com/post-slug to redirect any "post-开发者_如何学编程slug" to http://newsite.com/post-slug automatically.


On your old page add the following to the .htaccess:

RewriteEngine On
RewriteRule (.*)$ http://newsite.com/$1 [QSA,NC,R=301]

That will redirect each link including the page name to the new domain. The flags will also sent the additional parameters and make the URL case-insensitive. The R=301 will tell search engines, that it is a permanent redirect so they might update theit indexes faster.

0

精彩评论

暂无评论...
验证码 换一张
取 消