开发者

Redirect IP address to domain name

Not sure how it happened, but Google has indexed my site both by IP address and domain name and in some search in Google I see my site like 121.12.12.123/tech/tech.php.

Please let me know how can I redirect it to my domain?

121.12.开发者_如何学运维12.123    redirect to   www.mydomain.com
121.12.12.123/*  redirect to   www.mydomain.com/*


If your site is running on a apache webserver, you could use mod_rewrite and put something like this in your .htaccess:

RewriteCond %{HTTP_HOST} ^121\.12\.12\.123
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜