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. Rel Canonical, Follow/No Follow in htaccess?

    Rel Canonical, Follow/No Follow in htaccess?

    Technical SEO Issues
    5 4 340
    • 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.
    • moon-boots
      moon-boots last edited by

      Very quick question, are rel canonical, follow/no follow tags, etc. written in the htaccess file?

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

        Hi

        I dont think you can use rel-canonical tags in httaccess however you can define the rule for follow / no follow tag through htacess.

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

          Hi there,

          They'll be written in the source code of each applicable page.

          Alternatively you can dynamically add these tags via google tag manager or within your CMS platform.

          regards,

          Sean

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

            Robots directives and rel=canonical can be assigned by .htaccess.  This is a very handy way to assign noindex or rel=canonical to .pdf documents, print formats, video transcripts, etc.  You can also use it to apply noindex or rel=canonical at scale.   Two  Moz articles (of several) that describe these are....

            https://moz.com/blog/how-to-advanced-relcanonical-http-headers

            https://moz.com/blog/htaccess-file-snippets-for-seos

            moon-boots 1 Reply Last reply Reply Quote 2
            • moon-boots
              moon-boots @EGOL last edited by

              Hello,

              Thank you for this information, but I have a followup question. The links you sent me refer to images and PDF's, but this isn't relative to my situation. I need to write in follow/no follow and rel=canonical via htaccess because I do not know how to do it for each individual page on my ecommerce store - additionally, htaccess is easy for me to edit if ever I need to undo something and it is nice to have everything in one place.

              Can you give me a formatted example of how a follow/no follow and rel=canonical can be placed into a page via the htaccess file please? I intend on doing this for every product category, product and also my home page on my ecommerce store.

              Thank you

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • Rel=canonical or 301 to pass on page authority/juice
                ThompsonPaul
                ThompsonPaul
                0
                6
                101

              • Meta data & xml sitemaps for mobile sites when using rel="canonical"/rel="alternate" annotations
                Dr-Pete
                Dr-Pete
                0
                2
                714

              • Canonical & rel=prev / next changes to website a good idea or not?
                0
                1
                141

              • Combining 2 blogs into one. What is quicker, easier and better - rel canonical or an htaccess/ 301?
                Highland
                Highland
                0
                6
                232

              • Duplicate Page Content / Rel Canonical
                Joseph-Green-SEO
                Joseph-Green-SEO
                0
                13
                349

              • Should i use NoIndex, Follow & Rel=Canonical Tag In One Page?
                DigitalJungle
                DigitalJungle
                0
                3
                2.3k

              • Rel canonical with index follow on query string URLs
                panini
                panini
                0
                4
                1.4k

              • Follow up from http://www.seomoz.org/qa/discuss/52837/google-analytics
                KeriMorgret
                KeriMorgret
                0
                8
                1.1k

              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