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.
精彩评论