3

I developed my website under /var/www/html (for the development part) so I can consult the website when I enter the server's IP address into my web browser. On the same server I have the same products under /var/www/example.com and it's this domain than I want indexed on Google.

My problem is that Google has indexed both. So sometimes the goods appears in Google with example.com and sometimes Google displays the IP address of the server.

So I added meta robots noindex nofollow, and also disallow: / into robot.txt to remove the IP address version of the site from Google search console. However, the IP address was still showing up in Google. So I decided to remove completely all files under /var/www/html and left just the nginx html page. However, I still have the same problem. The IP address is always displayed in Google. I noticed than the meta description is ignored too. Google takes the old description.

Can you tell me if I did something wrong or what I have to do to remove this IP from google search. How long do we need to wait to see changes?

5
  • 1
    If you disallow in robots.txt then Google can't see your meta tags. Only do the meta and then wait a month. Commented Nov 24, 2018 at 10:32
  • Oh ok so I did a mistake :/ I'll remember for the next time. If I deleted all project inside /var/www/html it's fine too ?
    – John
    Commented Nov 24, 2018 at 10:57
  • When you remove the files, is your site unavailable at the IP address? If so, that should work. Again you need to wait a month or two for Google to fully re-crawl the whole site at the IP address and realize it is gone. Commented Nov 24, 2018 at 11:44
  • I'll not see the site because I removed all html css and js files. I just let nginx html page.
    – John
    Commented Nov 24, 2018 at 11:51
  • You can request URL removal from Search Console (Formerly, Google Webmaster Tools).
    – zipkundan
    Commented Nov 26, 2018 at 5:49

1 Answer 1

3

The best solution is to configure your web server to redirect those who visit the IP address to the domain name (i.e. 301 redirect http://0.0.0.0/* to https://example.com/*.

If that's not an option, then you can use canonical meta tags on each of your pages, specifying to search engines that your domain name is the version of the site you want indexed.

<link rel="canonical" href="https://example.com/your/page/path/" />

More info:

https://moz.com/learn/seo/canonicalization

https://support.google.com/webmasters/answer/139066?hl=en

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.