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. Canonical redirects

    Canonical redirects

    Technical SEO Issues
    3 2 98
    • 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.
    • socialengaged
      socialengaged last edited by

      Hello,

      I have a quick question: I use wordpress for my website. I have a plugin for translating the website in other languages. Thus, I have 2 versions of urls, one with /en, one without (original languale). This has been seen as duplicate content.

      I have been advised that the best to do is to use canonical redirect. Should I use it on the general header.php (the only header I can find in the CMS), or should I redirect each page singularly? I believe the second is the best way, but I can't find headers and txt documents for each page in my FTP.

      As well I have seen this post, in which is explained that canonical redirects can be done directly in the general header.php http://www.bin-co.com/blog/2009/02/avoid-duplicate-content-use-canonical-url-in-wordpress-fix-plugin/

      Is it true? You have any suggestion?
      Thanks! 🙂

      Eugenio

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

        Since you are using wordpress you won't have individual pages in your FTP. The only way you could edit something into the individual pages would be each posts edit page on the CMS. However, I don't know if doing that would work since its technically beneath the head.

        And yes the canonical redirect can be done in the general header, although personally I would load it as a php IF criteria. In other words you add it to the general header but tell it only to load that if i t is on one of these /en pages. That way you don't have the canonical applied to other pages you actually want, or the main page that it is directing too as that would cause an odd loop for the spiders that I doubt they would respond positively too.

        Here you can find a quick sample of working with the PHP if page criteria: http://stackoverflow.com/questions/7997016/if-this-page-show-this-else-show-this

        Good luck!

        1 Reply Last reply Reply Quote 2
        • socialengaged
          socialengaged last edited by

          Thank you Adam,

          Very good answer, thats what I needed 🙂

          Please let me know if I understood good:

          Should I replace the /contact.php in the example to my real address /en/contact?

          And basically I should put the below condition. Should I write this code for each url i want to redirect? so that it would be like

          if /en/contact, then  rel="canonical" /contact

          else /contact

          if /en/about-us, then  rel="canonical" /about-us

          else /about-us

          etc?

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Should the canonical tag for the redirected pages be changed
            AnahitG
            AnahitG
            0
            3
            31

          • 301 Redirect Url Within a Canonical Tag
            MikeRoberts
            MikeRoberts
            0
            2
            70

          • Change URL or use Canonicals and Redirects?
            LoganRay
            LoganRay
            0
            5
            85

          • Rel=canonical redirect form sign-up to homepage
            tracktest.eu
            tracktest.eu
            0
            3
            101

          • Do I need both canonical meta tags AND 301 redirects?
            Dr-Pete
            Dr-Pete
            0
            4
            1.1k

          • Redirect non-www if using canonical url?
            RobertFisher
            RobertFisher
            0
            3
            515

          • Canonical tag, CNAME and 301 redirect
            gfiorelli1
            gfiorelli1
            0
            10
            2.2k

          • Permanent 301 redirects vs canonical urls?
            sferrino
            sferrino
            0
            4
            725

          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