I recently got an SSL for my website and I'm trying to set up a htaccess so whenever someone joins the site it automatically takes them to the secure version of the site, but whenever I upload my htaccess with the code containing the redirect I got the too many redirect error, this is my code.

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.scryptedhosting.com/$1 [R,L]

This code for some reason results in a too many redirect loop, can anyone help as to why?

Sincerely Tom.

  • Contact your host - some hosts require variations on this rule for it to work. (Arcus Tech are one host I'm familiar with who use a different rule for SSL redirects.) Aug 29, 2015 at 15:03
  • Arcustech for example uses # Direct to https RewriteCond %{ENV:SECURE_REDIRECT} !=on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] Aug 30, 2015 at 9:14

1 Answer 1


try this:

RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule (.*) https://www.domain.com/$1 [R=301,L]

Do you know if there is a load balancer in front of your servers?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.