0

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.) – Derek Hogue Aug 29 '15 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] – Justin Long Aug 30 '15 at 9:14
0

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?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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