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. Redirect Chain Issue

    Redirect Chain Issue

    Technical SEO Issues
    3 3 254
    • 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.
    • FitzSWC
      FitzSWC last edited by

      I keep running into a redirect chain issue trying to get a non-https/non-www domain to forward directly to the https/www domain on an Apache server. For background, we are forcing https and forcing www, but it appears the non-https/non-www domain is first redirecting to https/non-www and then redirecting again to the desired final https/www version of the domain. (Hope I am making sense here)

      I am trying to find code to add to my .htaccess file that will perform the following...

      301 Redirect
      http://example.com directly to https://www.example.com (without 1st redirecting to https://example.com)
      http://www.example.com directly to https://www.example.com

      Any experts in this with any thoughts?

      Thanks,
      Fitz

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

        There is rewrite code to do that in one "hop". But the best practice for this has changed from what the pagespeed tools recommend, Fitz. You should actually leave the redirect as is, and insure you have HSTS properly implemented for the website. For HSTS to work properly/securely, the site must redirect to the HTTPS version of the same hostname before then redirecting to the canonical hostname. Which is exactly what your site is doing.

        The only disadvantage to the extra hop is that there's a very small delay for an additional server calll, but the implementation of HSTS eliminates a server call and some certificate negotiation time. So breaks about even or even a little quicker, especially if you submit to the Preload list once you're certain HSTS is working correctly. Note that HSTS should be implemented using a very short TTL initially so you can be sure things are working correctly before switching to a long TTL and the preload list.

        Do you already have HSTS configured for the site??

        Paul

        1 Reply Last reply Reply Quote 1
        • GardenGamer
          GardenGamer last edited by

          Hi,

          I was wondering exactly the same thing as above - in MOZ it classes this as a redirect chain.

          Is this an issue that it picks up that isn't really a problem?

          we are using:

          RewriteRule (.) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
          RewriteCond %{HTTP_HOST} !^www.MYSITE.co.uk [NC]
          RewriteCond %{HTTP_HOST} !^$
          RewriteRule ^(.
          ) https://www.MYSITE.co.uk/$1 [L,R=301]

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Redirection chain and Javascript Redirect
            0
            1
            19

          • How do I handle a redirect chain issue pertaining to a page that doesn't actually exist on my site?
            NiteSkirm
            NiteSkirm
            0
            3
            38

          • Redirect Chain Issues - Cannot Fix
            ruislip18
            ruislip18
            0
            5
            269

          • Redirect and ranking issue
            Eric.W.Caudle
            Eric.W.Caudle
            0
            4
            69

          • SSL redirect issue
            Matt-Williamson
            Matt-Williamson
            0
            2
            110

          • 301 redirect chains
            DRUM.SEO
            DRUM.SEO
            0
            7
            5.4k

          • Domain Redirect Issues
            Jinx14678
            Jinx14678
            0
            3
            958

          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