Mobile app version of vmapp.org
Login or Join
Dunderdale272

: Index site via domain name, but not via direct IP For some context, I'm modifying somebody's website. This particular site is not yet published - it is accessible via direct IP. Problem: Google

@Dunderdale272

Posted in: #Domains #IpAddress #RobotsTxt

For some context, I'm modifying somebody's website. This particular site is not yet published - it is accessible via direct IP.

Problem: Google has crawled the direct IP, and people are reaching the site. If we put a robots.txt into the root directory of the site, that would also prevent Google from indexing the site once it's published on an actual domain.

Is there any way using robots.txt to prevent search engines from indexing the site's pages over direct IP, but allow it to index the site via its domain name?

(If not, then what would be required is to serve a different robots.txt depending on what domain the site is running on. The server could look at the HOST header to do this, but what is the best way?)

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Dunderdale272

1 Comments

Sorted by latest first Latest Oldest Best

 

@Fox8124981

You need to do a 301 redirect from the IP address to the pages. Also use rel="canonical" microformat at the html head, here you state the url for every page.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme