4

I have searched but didn't find exactly like my situation, so need clues to understand this.

I have just hosted a site for client. Submitted sitemap on google search console. Rest of the URLs are indexed fine but Google indexed the homepage with completely wrong domain.

How can this happen and how to request Google to re-index my home page with correct URL?

enter image description here

  • 2
    Submitted sitemap on google search console ... Just so you know, this does not index your website. This simply allows you to gain some insights via the Google Webmasters Tool. Insights, such as errors and general activity. It also always you to re-crawl (Fetch) pages, in the event you may have changed it's Title or Meta Description etc. – Craig Jul 12 '18 at 15:26
5

There are two ways this can happen:

  1. Another domain name points to your server. Your server is doesn't have a specific rule for that domain and defaults to serving the content of your main site.

  2. Somebody is copying your entire site, possibly through a reverse proxy.

In your case, it appears that the IP address for the two domains resolve to a similar IP address. Both IP addresses may be assigned to the same server.

You can change your server such that it doesn't blindly serve up your domain content for any old domain that points to it. Instead the default behavior could either be to redirect to your site, or to serve up an error page. Only requests for your domain name should show your content.

One way of doing so is with a rule in your .htaccess file that redirects any host name other than yours:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

It looks like you have already made such a change. When I put an HTTP request in for the other domain name or your IP addresses, I see "301 Permanent" redirect to your site. Google should pick up on those redirects within a couple weeks and you will be fine.

Another solution that can work is including canonical tags in all your pages. Then when Google finds pages at alternate addresses, Google knows what your preferred domain name should be. Google doesn't always honor canonical tags, but in a case like this it should do so eventually. Canonical tags can work for the reverse proxy cases where you don't have control of the server.

  • "In your case, it appears that the IP address for the two domains resolve to a similar IP address. Both IP addresses may be assigned to the same server." Seems very odd to me that this could happen. Site is hosted on VPS. Will consult with hosting provider. Thanks! – Laraveldeep Jul 12 '18 at 16:24
  • 1
    It isn't uncommon to have multiple network interfaces on a server. The second IP could also be to a load balancer. – Stephen Ostermiller Jul 12 '18 at 18:19
  • 2
    I hadn't noticed the https on the thing in Google's results. curl --insecure -s --head https://beerfactory.pragyan.org/ HTTP/1.1 200 OK You should set up redirects for that so it doesn't return 200 OK. – Stephen Ostermiller Jul 13 '18 at 10:20
  • 1
    As long as that host name is pointed at your server, you can redirect it. I added a rewrite rule based on the host name you can use. – Stephen Ostermiller Jul 14 '18 at 9:45
  • 1
    Configured to return 444 for unintended domain other than my own both for HTTP and HTTPS. Their HTTPS has 301 redirect. I hope Google will pick up changes. Is there anything else I can do from side? Thanks for your valuable suggestion! – Laraveldeep Jul 16 '18 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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