1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redundant hostnames in GA

Discussion in 'Forum Management' started by Dakis, Oct 30, 2014.

  1. Dakis

    Dakis Well-Known Member

    I just got a funny message in my google analytics, telling me this:

    What is this about? And why did it show up just now? Did google make any changes? cause I haven't changed anything on my site for a while.

    This is my .htaccess:

    Code:
    # xenforo start
    
    
    RewriteEngine On
    RewriteCond % ^travelstories.gr [NC]
    RewriteRule ^(.*)$ http://www.travelstories.gr/$1 [L,R=301]
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
    Redirect 301 /index_forums.php http://www.travelstories.gr/community
    Redirect 301 /mag http://www.travelstories.gr/community
    Redirect 301 /community/portal http://www.travelstories.gr/community
    
    # xenforo end
    
    RedirectMatch permanent ^/$ http://www.travelstories.gr/community/
    
    
     
  2. cdub

    cdub Well-Known Member

    I have this same issue
     
  3. melbo

    melbo Well-Known Member

  4. Alfa1

    Alfa1 Well-Known Member

  5. Dakis

    Dakis Well-Known Member

    Thanks for your responses fellows - any idea how I can correct my rewrite rule to redirect the non-www to the www version of my site?
     
  6. ForestForTrees

    ForestForTrees Well-Known Member

    I have exactly the same problem. I'd be curious as to how to fix it with cPanel. It's not as easy as one might hope.
     
  7. cdub

    cdub Well-Known Member

    Yes I'm getting error too. It's pretty recent and I haven't made any changes to my server.
     
  8. GoPluto

    GoPluto Active Member

    bump, any solution to this?
     
  9. Dakis

    Dakis Well-Known Member

    I haven't figured out what to do , no.
     
  10. GoPluto

    GoPluto Active Member

    fixed it.

    Put this at the top of your .htaccess file:

    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
     
    Dakis likes this.
  11. Dakis

    Dakis Well-Known Member

    What does that do?
     
  12. Alfa1

    Alfa1 Well-Known Member

    That only forwards www to http. But not http to https.
     
  13. GoPluto

    GoPluto Active Member

    it makes it so every time someone pulls up your site using www.thisisjustatest.com/testpage or whatever, it automatically redirects to http://thisisjustatest.com/testpage

    It removes the www leaving just one hostname, therefore google wont complain that you have two sites essentially as its perceived by them with and without the www.
     
    Dakis likes this.
  14. GoPluto

    GoPluto Active Member

    add this after the code I gave. if you want the secure https. But I recommend everyone just uses the code above for normal sites.

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
     
  15. Dakis

    Dakis Well-Known Member

    Thanks I'll give it a shot.
     
  16. Dakis

    Dakis Well-Known Member

    In doing those changes, do I need to remove these lines out of my .htaccess?

    Otherwise it might end up doing a loop?
     
  17. ForestForTrees

    ForestForTrees Well-Known Member

  18. keith.arvixe

    keith.arvixe Active Member

    Resolving to HTTPS should fix it all and making one direct link. IE www and not https://yourdoimain.com kinda thing. I think Google is trying to make it the same for all sites.
     
  19. Dakis

    Dakis Well-Known Member

    The problem is my htaccess already has a rule for redirecting , which was working at first but not anymore apparently - can anyone think of why this happens? Note this is the htaccess located in the root directory - in the xenforo directory I've got another one.
     

Share This Page