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. Do I need to do a 301, as well as adding re-write rules on Apache

    Do I need to do a 301, as well as adding re-write rules on Apache

    Intermediate & Advanced SEO
    3 3 172
    • 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.
    • Ultramod
      Ultramod last edited by

      I'm sure this has probably been asked somewhere before...

      We're implementing a URL re-write rule to convert non dub pages to the www. subdomain and also removing all trailing slashes as part of a basic canonicalisation exercise.

      The question is, as well as doing the URL rewrites within htaccess, should I also 301 those duplicate pages or does the URL rewrite do the job on it's own?

      Thanks mozzers.

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

        The URL rewrite "should" take care of it. So, when you enter www.domain.com/page.html it would 301 redirect to domain.com/page.html (or vice versa). Once you have the rewrites in place, then test them by going to a page and see if it redirects properly. Use a http server header checker to see if it's serving up a 301.

        Even though the internal links may be using your preferred domain, then you'll want to make sure that anyone requesting (or linking to) the "wrong version" will be 301 redirected to the right version of the page.

        Also, I would go into Google Search Console and make sure you tell Google which version is your preferred version: the www or non-www version of your site.

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

          Eric's answer was perfect. After launch, I also do a site:nameofdomain.com and click on a random sampling of links to make sure the rules work perfectl (this is more useful if the page name changes). Good luck!

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • 301 re-direct affect on SERPS
            steviechat
            steviechat
            1
            3
            41

          • 301 redirection help needed!
            Nigel_Carr
            Nigel_Carr
            3
            6
            86

          • Is it bad I have a cluster of canonical urls that 301 re-direct?
            lunavista-comm
            lunavista-comm
            0
            4
            98

          • Clarity needed on 301 redirects
            JSimmons17
            JSimmons17
            0
            3
            71

          • 301 redirect rule
            MichaelC-15022
            MichaelC-15022
            0
            8
            343

          • Is a 301 to a 301 ok?
            EcommerceSite
            EcommerceSite
            0
            7
            182

          • Need advice on 301 domain redirection
            Marcus_Miller
            Marcus_Miller
            0
            3
            269

          • Had lots of issues with ranking well | advice needed
            TheeDigital
            TheeDigital
            0
            5
            313

          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