Help with an HT Access issue: A bit urgent!

For some time, years, I’ve used the following HT Access code to route all calls to the https://www. version of a site. (Changing the domain accordingly of course).

RewriteOptions inherit
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301,NC]

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$$1 [R,L]

RewriteEngine on
ErrorDocument 404

I’ve just added it to a new site, and it’s breaking. Safari is returning an error page with a “too many redirects” message. But as I say, I’ve used this for years and it’s fine. And looking at it, I can see no errors.

It’s live tight now on site here:

If I remove the code from the HT Access doc the full URL, with the https and the www bit works fine. So it’s not an SSL issue, it just seems to be an issue with the code. But what?


I have used the following for years without any issues:

RewriteCond %{HTTP_HOST} domain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]

Just tried yours. Same.

I think this must be an issue with how the nameservers are configured.

I’ve now removed the htacess code for the redirects, so the site is now working correctly. Thanks to Webdeers code it’s clear this is not an issue with the htaccess doc, per se, but something deeper. Nameservers is my guess.

So, no need for anyone to post telling me the site is working for them: it’s now woeking for everyone, allbeit with out redirects. But if anyone has any ideas as to what was/is causing this issue, I’m all ears!

Try this:

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^{REQUEST_URI} [L,R=301]

I am getting a certificate error.

Thanks. The tech peeps are working on it this am.