开发者

One site and several domains. How setup redirect?

开发者 https://www.devze.com 2023-02-19 08:47 出处:网络
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=944And after user return to that page,

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

精彩评论

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