开发者

One site and several domains. How setup redirect?

I've got site on .org domain. Now, I'm moving it to .com. For exmaple, I've got product page, that user saved in brows开发者_运维技巧er test.org/item.php?id=944 And after user return to that page, I want to move him to the test.com/item.php?id=944 Should I save old site structure with redirect?


Use the .htaccess file to do a 301 redirect(moved permanently status code):

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)test.org [NC]
RewriteRule ^(.*)$ http://test.com/$1 [R=301,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜