Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redundant Hostnames Google Analytics

Google Analytics notices a unsolve the problem Redundant Hostnames:

Property http://www.domain.com is receiving data from redundant hostnames:

The old tracking code is still using to track and the website does not use Universal Analytics tracking code, yet.

We have the large website and Google Analytics is a small portion of the website team. We are still get information for the which servers in the the webpage.

Is it possible to quick fix the redundant hostnames notification in Google Analytics?

like image 387
user1824960 Avatar asked Dec 04 '25 15:12

user1824960


1 Answers

I have walking through this issue which i discovered today in my Anayltics account! Anyway i have found a good solution for Normal websites and WordPress based blogs.

First for normal website(s):

  1. Open your website root .htaccess file and paste this code:

    RewriteEngine On (if this line exists, then don't add this line again).
    # Rewrite all requests to the 'www' version
    RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
    RewriteRule ^.*$ http://www.yourdomain.com%{REQUEST_URI} [R=301,L]

Second for WordPress Based Blog(s):

  1. Open your website root .htaccess file and paste this code:

    # 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

Please note that you have to change "yourdomain" with your actual domain name.

Thank you and hope this help.

like image 56
Mizo Games Avatar answered Dec 09 '25 19:12

Mizo Games



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!