Google Indexed Homepage with Completely Wrong Domain

by Laraveldeep   Last Updated July 12, 2018 12:04 PM

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 the google indexed the homepage with completely wrong domain.

How can this happen and how to request google to re-index my homepage with correct URL?


enter image description here

Answers 1

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 ^(.*)$$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.

Stephen Ostermiller
Stephen Ostermiller
July 12, 2018 14:36 PM