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. Redirect chains from switch to HTTPS

    Redirect chains from switch to HTTPS

    Intermediate & Advanced SEO
    15 6 2.1k
    • 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.
    • iugac
      iugac last edited by

      I guess you could probably do this by checking the https rule at last. So if it is old.php, the first thing you do is redirect to the new.php but already on the https. So all your static redirects will automatically go to https with one redirect while the other will always reach the last rule and go to the secure versions. Let me know if this helps.

      roundabout 2 Replies Last reply Reply Quote 2
      • roundabout
        roundabout @iugac last edited by

        Thank you! Will try and let you know 🙂

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

          The easy solution (and recommended best practice) is to put the specific individual redirects above the HTTPS redirect in the htaccess file. Just make certain the legacy individual redirects point to the correct HTTPS version to start with.

          It's standard procedure to have an htaccess file list the most specifically targeted rules first, gradually moving to the more general.

          Hope that helps?

          Paul

          roundabout 1 Reply Last reply Reply Quote 3
          • roundabout
            roundabout @iugac last edited by

            So the developer got back to me and said he had tried that but the redirect chain still occurred. Any other ideas?

            1 Reply Last reply Reply Quote 0
            • roundabout
              roundabout @ThompsonPaul last edited by

              So the developer got back to me and said he had tried that but the redirect chain still occurred. Any other ideas?

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

                Hi Lori. The solution the other commenters have suggested is definitely the way to do this - so it sounds like it needs more debugging. I suspect it's to do with the [L] option being needed on the specific redirect once it's moved above the general http-->https redirect. This stops other redirects below it firing, if I remember correctly.

                If that doesn't work, do you want to share back here the specific different htaccess files the developer has tried?

                roundabout 1 Reply Last reply Reply Quote 2
                • roundabout
                  roundabout @willcritchlow last edited by

                  Thank you Will! Just one question, so if it's a simple redirect from one page to another, it would look like this? Or is adding [R=301,L] only for those that start with RewriteRule?

                  Redirect 301 /Bamboo https://www.fauxpanels.com/style-wood.php [R=301,L]

                  willcritchlow 1 Reply Last reply Reply Quote 0
                  • willcritchlow
                    willcritchlow @roundabout last edited by

                    Hi Lori,

                    On closer inspection, I think that only the rewriterule should have the [L] flag and that placing the specific Redirect at the top of the file should work fine without chained redirects as the other commenters suggested. I tested that here: http://htaccess.mwl.be/ and it appears to work fine using the following .htaccess - can you confirm with your developer that this is what they were trying?:

                    Redirect 301 /old.php https://www.clientdomain.com/new.php

                    RewriteEngine on

                    if non-SSL and one of these, redirect to SSL

                    RewriteCond %{HTTPS} !on
                    RewriteRule ^(.*)$ https://www.clientdomain.com/$1 [R=301,L]

                    roundabout 1 Reply Last reply Reply Quote 1
                    • roundabout
                      roundabout @willcritchlow last edited by

                      Hi Will,

                      That is correct - the developer told me that's exactly what he did. Could I send you a screenshot of the actual .htaccess file in a private message?

                      Thank you!

                      willcritchlow 1 Reply Last reply Reply Quote 0
                      • willcritchlow
                        willcritchlow @roundabout last edited by

                        Yes - of course. Happy to take a look.

                        roundabout 1 Reply Last reply Reply Quote 1
                        • roundabout
                          roundabout @willcritchlow last edited by

                          Thank you!! Just sent it

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

                            Hi was this ever resolved as this would help many people?

                            roundabout 1 Reply Last reply Reply Quote 0
                            • roundabout
                              roundabout @lbagley last edited by

                              Hi,

                              We are still waiting for the developer to make the change. I will certainly post the answer when we know for sure!

                              Thanks

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

                                This post is deleted!
                                1 Reply Last reply Reply Quote 1
                                • 1 / 1
                                • First post
                                  Last post
                                • Redirect Chains
                                  kayl87
                                  kayl87
                                  0
                                  3
                                  137

                                • Website Not Performing after switch to HTTPS
                                  SMRTCHInteractive
                                  SMRTCHInteractive
                                  0
                                  3
                                  62

                                • Switching from HTTP to HTTPS: 301 redirect or keep both & rel canonical?
                                  Steven_Macdonald
                                  Steven_Macdonald
                                  0
                                  9
                                  3.1k

                                • Domain switch planned - new domain accessible - until the switch: redirect from new to old domain with 307?
                                  comicron
                                  comicron
                                  0
                                  6
                                  144

                                • Moving to https: Double Redirects
                                  Matt-Williamson
                                  Matt-Williamson
                                  0
                                  4
                                  928

                                • How to switch to HTTPs in Bing?
                                  OlegKorneitchouk
                                  OlegKorneitchouk
                                  0
                                  2
                                  231

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

                                • Redirect Chains - Accept the 301 chain or link from the original page??
                                  Houses
                                  Houses
                                  0
                                  9
                                  2.8k

                                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