solving redirect chain

  • Hi after running a Ahrefs site audit I have a redirect chain error, from the https://www version to the https://, do I just set up a 301 redirection for this as heard it can affect site speed aswell so trying to get it fixed


Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    I’ve checked your site, and indeed there is a redirect chain for your HTTP version. Could you please try this redirection in your .htaccess file instead? This will redirect your site to HTTPS and to non-www:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} ^www\. [NC]
    RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
    RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]

    Please generate a backup of your .htaccess first before making any changes.

    I hope that helps.

    Thank you.

    Brilliant will try this thank you, I have force https enabled on my siteground security will this affect that or is it just the same thing?


    Force HTTPS can work alongside the rule. Let us know how that goes.

    Looking forward to your update.


    I have placed the above code in htaccess file at the top but still seem to be getting the redirect error after running another Ahrefs site scan,


    Upon checking your site it is already using the non-www version for your main URL. The ahrefs error actually seems to be suggesting that there is a redirect of your main domain already.

    Upon checking your site on the HTTP status tool, there’s still a chain of redirects from the HTTP URL:

    http redirect

    You may want to consult your web host regarding this and how to remove the second redirect.

    You can proceed by using the WordPress default .htaccess file and clear your website cache.

    If it does not work then make a point of consulting your web host team to fix the issue for you as there may be a redirect chain setup on your server end.

    Hope this gives more clarification. Let us know if you have any other questions with you.

    I have solved the issue


    Thank you for the update.

    We’re glad that you have managed to resolve this redirect issue.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘solving redirect chain’ is closed to new replies.