The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Redundant Hostnames Issue in GA

    Redundant Hostnames Issue in GA

    Technical SEO Issues
    2 2 436
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TheCraig
      TheCraig last edited by

      I noticed another post on this, but I have another question.  I am getting this message from Analytics:

      Property http://www.example.com is receiving data from redundant hostnames. Consider setting up a 301 redirect on your website, or make a search and replace filter that strips "www." from hostnames. Examples of redundant hostnames: example.com, www.example.com.

      We don't have a 301 in place that manages this and I am quite concerned about handling that the right way.  We do have a canonical on our homepage that says:

      rel="canonical" href="http://www.example.com/" /> I asked on another site how to safely set up our 301 and I got this response:

      RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
      RewriteRule ^ http://www.example.com%{REQUEST_URI} [R=301,L,NE]

      Is this the best way of handling it?  Are there situations where this would not be the best way?

      We do have a few subdomains like beta.example.com in use and have a rather large site, so I just want to make sure I get it right.

      Thanks for your help!

      Craig

      1 Reply Last reply Reply Quote 0
      • The_Sage
        The_Sage last edited by

        Rewrites are generally regarded as the best way to handle this kind of redirect, but your DNS provider likely has their own redirect system in place that can implement the same functionality without modifying your site's .htaccess. Same result, different technique.

        The reason I use my DNS with a "www" subdomain record to forward to my non-www domain is because WordPress sometimes has issues with using RewriteRule. It seems to break permalinks. I always just set it once with my DNS host and never think about it again.

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        • Cannonical issue
          alihassanblogger
          alihassanblogger
          1
          3
          74

        • My site have a issue
          Christy-Correll
          Christy-Correll
          1
          2
          36

        • Issue with GA tracking and Native AMP
          KaneJamison
          KaneJamison
          0
          2
          69

        • We need a bit of help from someone to fix the following issues causing speed issues on our website.
          Andy.Drinkwater
          Andy.Drinkwater
          0
          4
          71

        • How to fix this issue?
          danatanseo
          danatanseo
          0
          5
          95

        • Subdomains Issue
          SanketPatel
          SanketPatel
          0
          5
          248

        • Crawl issue
          Mrlocicero
          Mrlocicero
          0
          3
          202

        • Caninical issue
          MPO
          MPO
          0
          9
          698

        Get started with Moz Pro!

        Unlock the power of advanced SEO tools and data-driven insights.

        Start my free trial
        Products
        • Moz Pro
        • Moz Local
        • Moz API
        • Moz Data
        • STAT
        • Product Updates
        Moz Solutions
        • SMB Solutions
        • Agency Solutions
        • Enterprise Solutions
        • Digital Marketers
        Free SEO Tools
        • Domain Authority Checker
        • Link Explorer
        • Keyword Explorer
        • Competitive Research
        • Brand Authority Checker
        • Local Citation Checker
        • MozBar Extension
        • MozCast
        Resources
        • Blog
        • SEO Learning Center
        • Help Hub
        • Beginner's Guide to SEO
        • How-to Guides
        • Moz Academy
        • API Docs
        About Moz
        • About
        • Team
        • Careers
        • Contact
        Why Moz
        • Case Studies
        • Testimonials
        Get Involved
        • Become an Affiliate
        • MozCon
        • Webinars
        • Practical Marketer Series
        • MozPod
        Connect with us

        Contact the Help team

        Join our newsletter
        Moz logo
        © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
        • Accessibility
        • Terms of Use
        • Privacy