How To Fix Redundant Hostnames Error In Google Analytics

How To Fix Redundant Hostnames Error In Google Analytics

Google analytics is showing a new notification named Redundant Hostnames which is a quite common error to all the website owners. So many website owners are concerned and the fix to this error is quite simple and easy to do. The description of Redundant Hostnames says “Property yourdomain.com is receiving data from redundant hostnames”. So in this article i will explain you how to fix this warning.

Redundant Hostnames

Description Of Redundant Hostnames Error

In Google Analytics when you click on the details in the warning notification it says:

Property YourDOmain is receiving data from redundant hostnames. Some of the redundant hostnames are:

  • yourdomain.com
  • www.yourdomain.com

Redundant hostnames are counted as separate rows in reports, so hits that are going to the same page on your site from different hostnames will be split into multiple rows. With data split across multiple rows, traffic to specific pages will appear lower than it actually is.

To avoid this problem, consider setting up a 301 redirect from one of your redundant hostnames to the other, or create a search-and-replace filter that strips “www.” from hostnames.

This warning message started appearing after an update in 2014. With this error a search engine thinks that there are two domains available and the content in two different domains is same. This probably will be considered as duplicate content.

To overcome this error you have make a 301 redirect of all your pages pointing to your domain. If someone types my site url as tech1xpert.com then they will be automatically redirected to www.tech1xpert.com. In this way the search engine thinks that there is only domain available.

Fix for Redundant Hostnames Error

These below steps work when you are using a hosting and wordpress installed in it. Normally this fix can be acheived by tweaking .htaccess file in your hosting. Here are the steps to follow.

  1. Open your hosting CPanel and go to File Manager.Redundant Hostnames
  2. Go to public_html folder and find .htaccess file there. Normally all these .(dot) files are hidden. So if there is any option to show them click on unhide to show .htaccess file.
  3. Right click on .htaccess file and click edit (In my case iam using Godaddys CPanel). Redundant Hostnames
  4. Assuming that you have already installed wordpress, the .htaccess file consists of following text:
    #BEGIN WordPress 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase / 
    RewriteRule ^index\.php$ - [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /index.php [L] 
    </IfModule> 
    # END WordPress
  5. Now you have to add the following lines just below RewriteEngine On line:
    RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC] 
    RewriteRule ^.*$ http://www.yourdomain.com%{REQUEST_URI} [R=301,L]

    Note: Replace yourdomain with your domain name in the above text

  6. After adding the above text the entire .htaccess file will look like this:
    # BEGIN WordPress 
    <IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC] 
    RewriteRule ^.*$ http://www.yourdomain.com%{REQUEST_URI} [R=301,L] 
    RewriteBase / 
    RewriteRule ^index\.php$ - [L] 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /index.php [L] 
    </IfModule> 
    # END WordPress
  7. Now save your .htaccess file and check if yourdomain.com is redirecting your website to www.yourdomain.com in any browser.Redundant Hostnames
  8. Once done, go back to Google Analytics and click on the Redundant Hostnames warning and click on “verify“.

This is the solution to solve the Redundant Hostnames error in Google Analytics. Wait for around 24-48 hours for google to check the new redirection and you are done.

Hope you like this article. Don’t forget to share it and feel free to comment!

Comments

comments

Powered by Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *