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. Intermediate & Advanced SEO
    4. Duplicate content resulting from js redirect?

    Duplicate content resulting from js redirect?

    Intermediate & Advanced SEO
    6 2 2.3k
    • 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.
    • SCW
      SCW last edited by

      I recently created a cname  (e.g. m.client-site .com) and added some js (supplied by

      mobile site vendor to the head which is designed to detect if the user agent is a mobi device or not. This is part of the js:

      var CurrentUrl = location.href var noredirect = document.location.search; if (noredirect.indexOf("no_redirect=true") < 0){ if ((navigator.userAgent.match(/(iPhone|iPod|BlackBerry|Android.*Mobile|webOS|Window

      Now... Webmaster Tools is indicating 2 url versions for each page on the site - for example:

      1.) /content-page.html

      2.) /content-page.html?no_redirect=true

      and resulting in duplicate page titles and meta descriptions.

      I am not quite adept enough at either js or htaccess to really grasp what's going on here... so an explanation of why this is occurring and how to deal with it would be appreciated!

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

        The easiest way to fix this is to tell google to ignore the URL variable no_redirect . You can do this in webmaster tools under Configuration > URL parameters. find where no_redirect is listed, click edit and set it to "used for tracking".

        Remember to do similar for bing.

        You could also block these in robots.txt

        SCW 1 Reply Last reply Reply Quote 2
        • SCW
          SCW @matbennett last edited by

          Hi Mat,

          Thanks for the response!

          I am really trying to understand what is occurring here and how to remedy via js or htaccess.

          Can you please provide further insight?

          Thank you.

          matbennett SCW 3 Replies Last reply Reply Quote 0
          • matbennett
            matbennett @SCW last edited by

            I'm not great with JS myself - I'm lucky enough to employ people to do that for me! However, here is what the script is doing:

            1. First check whether "no_direct=true" has been set - presumably to allow users to override the mobile version and view the full desktop version if they choose
            2. If that hasn't been set then look to see if they are using iPhone/iPod/Blackberry/Android browsers
            3. Presumably the next line is then redirecting.

            That seems fairly logical - no real problem there.  However the mobile version is getting picked up and indexed somewhere.

            Because you want users to have access to that "duplicate" version, but don't want the search engines too you don't really want to either prevent this URL from existing or override it with .htaccess .  It would be smarter to pick a method that targets the search engines, such as:

            • Stop them crawling it (through webmaster tools or robots.txt)
            • Add  a no-index tag to it
            • Canonical it back to the main content
            1 Reply Last reply Reply Quote 1
            • SCW
              SCW @SCW last edited by

              That makes perfect sense. I think I will try instructing webmaster to ignore the variable as you initially suggested. It's the quickest approach 😉

              Thank you very much for your time and wisdom - much appreciated!

              Dino

              1 Reply Last reply Reply Quote 0
              • matbennett
                matbennett @SCW last edited by

                You're welcome

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • 301 redirect to avoid duplicate content penalty
                  riyaaaz
                  riyaaaz
                  0
                  3
                  146

                • Duplicate Content: Is a product feed/page rolled out across subdomains deemed duplicate content?
                  danwebman
                  danwebman
                  0
                  4
                  146

                • Multiple 301 redirects and old site content appearing in Google results
                  Andy.Drinkwater
                  Andy.Drinkwater
                  0
                  9
                  376

                • Duplicate content reported on WMT for 301 redirected content
                  SEOAccount32
                  SEOAccount32
                  0
                  6
                  328

                • Should I redirect all my subdomains to a single unique subdomain to eliminate duplicate content?
                  DuProprio.com
                  DuProprio.com
                  0
                  3
                  445

                • Duplicate content even with 301 redirects
                  RyanKent
                  RyanKent
                  0
                  4
                  408

                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