tzlil asked
Member (0 upvotes)

Redirect Chain issue

Hello, i see in Ahrefs that i have Redirect chain issue. 

there are  2  links  

the first 301 Moved Permanently 

the second 


how to get this fixed thanks? :)  

Avatar for member KnowOneSpecial
Moderator (84 upvotes)

Your issue is this.. 

You redirect to

Then you redirect to

You should just redirect all http traffic to https and do not redirect www  to https://www then to https without the www.

redirect all http traffic to https://security....

redirect all https traffic with www prefix to https without www prefix...

So you should have two conditions and one rule ...

The following code solves your issue ( oh and I prefer not to use WWW in a url.. superfluous in my opinion )

Here it is for a linux server

(this test for https not on, and it also test for www in url and if either condition is true it redirects to the correct url in one redirect no two redirects like you have on your site.

RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} ^www\.

RewriteRule (.*){REQUEST_URI} [L,R=301]

Good advice?
Comments 0
login to reply
Copyright ©2024 SEOChat. All Rights Reserved. Owned and operated by Search Ventures Ltd and Chris Chedgzoy.