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 Chain Advice

    Redirect Chain Advice

    Intermediate & Advanced SEO
    3 2 709
    • 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.
    • DaleZon
      DaleZon last edited by

      Hi,

      i hope you can help.

      My site crawl is showing that I have a redirect chain on my home page. Basically it shows I am going from :

      http: > https: > https://www.

      I need everything to go from http:// and http://www directly to https://www. without the chain.

      Below is a copy of the htaccess, can anyone see if there is an error in there that could be causing it.

      RewriteEngine On
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

      BEGIN WordPress

      <ifmodule mod_rewrite.c="">RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]</ifmodule>

      END WordPress

      In addition, i have seen that they have a plugin called

      SSL insecure content fixer installed.

      It is showing this under its status:

      Array
      (
          [HTTPS] => on
          [PHPHANDLER] => /usr/local/php70/bin/php
          [HTTP_X_REAL_IP] => 109.158.20.158
          [HTTP_X_FORWARDED_PROTO] => https
      )
      
      I think possibly this might have something to do with the issue, any thoughts are appreciated
      
      Thanks
      
      1 Reply Last reply Reply Quote 0
      • DaleZon
        DaleZon last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • Seenlyst
          Seenlyst last edited by

          Hello there,

          Actually, I think this article could really help you! https://www.danielmorell.com/guides/htaccess-seo/https-www-and-trailing-slash

          Alternatively, if you want to get the rules right away, just copy below, change the "example.com" to your domain then it should be working.

          Force HTTPS

          Force WWW

          Remove trailing / from file

          Turn on rewrite engine

          RewriteEngine on

          Check if not directory and ends in /

          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteCond %{REQUEST_URI} (.+)/$

          If not a directory skip next RewriteRule

          RewriteRule ^ - [S=2]

          Check if HTTPS and WWW

          RewriteCond %{HTTP_HOST} !^www.(.*)$ [OR,NC]
          RewriteCond %{https} off

          This RewriteRule skipped if URI was a directory

          RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

          This RewriteRule used if URI was a directory

          RewriteCond %{REQUEST_FILENAME} -d
          RewriteRule ^ - [S=1]
          RewriteRule ^(.*)/$ https://www.example.com/$1 [R=301,L]

          Do note, this 301 redirect your URL to the version with trailing slash, and because Google sees the trailing slash and non-trailing slash version of your pages as a different page, you should be doing a 301 to the right one. Read more about it here: https://www.seroundtable.com/google-trailing-slashes-url-24943.html

          Of course, you can choose to remove the trailing slash 301 redirecting, Moz doesn't redirect to either version, and they rank well. But sites like Neilpatel (they have unnecessary redirects) and Backlinko does redirect, and they rank well too. So it's up to you if you want Google to help you identify which version you prefer or you tell Google yourself.

          Finally, you can use this tool to check if your redirects are working as you expected: https://httpstatus.io/ (When you test, use a blog page or a specific page to test all the 8 variations because trailing slash doesn't matter at the homepage, take a look at screenshots below)

          uPeMS8X.jpg ugDMJZ9.jpg 0wtlmAX.jpg HV2Byd5.jpg

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • Advice on redirects for a category I want to reuse.
            neil_stickergizmo
            neil_stickergizmo
            0
            5
            37

          • How Critical to Address Redirect Chains?
            KevnJr
            KevnJr
            0
            3
            717

          • Redirect chains from switch to HTTPS
            roundabout
            roundabout
            1
            15
            2.1k

          • How can i solve this redirect chain issue?
            bilaljkdfgsaui
            bilaljkdfgsaui
            1
            5
            4.1k

          • How does Google treat chained 301 redirects?
            generalzod
            generalzod
            0
            3
            1.7k

          • Redirect advice
            djlaidler
            djlaidler
            0
            7
            176

          • Redirecting, then redirecting back
            Highland
            Highland
            0
            2
            256

          • Multiple 301 redirects considered a redirection chain?
            jmueller
            jmueller
            1
            16
            5.0k

          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