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. How to setup redirects

    How to setup redirects

    Intermediate & Advanced SEO
    2 2 66
    • 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.
    • brandonegroup
      brandonegroup last edited by

      Hi Guys,

      If you're doing an SEO migration and have multiple versions of the same page example:

      Version 1: http://naturesway.com.au/superfood/super-maca-powder

      Version 2: https://naturesway.com.au/superfood/super-maca-powder

      Version 3: https://www.naturesway.com.au/superfood/super-maca-powder

      And you want to redirect them to a new URL (new site):

      New Site: 

      https://www.naturesway.com.au/nw-superfoods-maca-powder-100g

      How would you ensure you redirect all the different versions of URL (versions 1,2,3) to the new URL on the new site?

      Cheers.

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

        I think it would be something like:

        <code>RewriteEngine On
        
        RewriteCond %{HTTPS} off
        
        RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
        
        RewriteCond %{HTTP_HOST} !^www\. [NC]
        
        RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
        
        This would go in your .htaccess file, you should be sure to edit the file via FTP so that if you break it, you can restore the old version and fix the site in seconds (keep a backup of the old .htaccess file)
        
        If you are on a windows-based server you'd need the equivalent rule for your web.config file as IIS doesn't use .htaccess
        
        For most sites, you have a .htaccess file and it sits in the root of your FTP (the same place that your primary index.php file lives, where robots.txt and sitemap.xml also usually reside)</code>
        
        1 Reply Last reply Reply Quote 2
        • 1 / 1
        • First post
          Last post
        • Would You Redirect a Page if the Parent Page was Redirected?
          Nozzle
          Nozzle
          0
          4
          92

        • Should I do a redirect
          0
          1
          33

        • To redirect or not to redirect, that is the question
          CommT
          CommT
          0
          5
          126

        • To Redirect or Not
          HashtagHustler
          HashtagHustler
          0
          9
          144

        • 301 Redirect To Another 301 Redirect
          cbielich
          cbielich
          0
          5
          247

        • Redirecting a redirect - thoughts?
          MikeRoberts
          MikeRoberts
          0
          2
          165

        • Redirect
          nyanainc
          nyanainc
          0
          3
          388

        • Duplicate titles but redirecting anyway (without redirects set up!!!)
          JGar-28032
          JGar-28032
          1
          2
          348

        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