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