Paul Konstanski
asked on
.htaccess to Remove SSL and Redirect www at same time
I recently upgraded to a new SSL certificate. My old used to include both the www and naked domains (e.g. https://www.chloedog.org and https://chloedog.org). But the new certificate only includes the naked domain.
I'm trying to use a .htaccess redirect so that both are accomplished in one pass. I've tried a few different things and none work.
The most recent was:
With the above, the following happens:
http://www.chloedog.org?129 - Works Fine
http://chloedog.org?129 - works fine
https://chloedog.org?129 - works fine
https://www.chloedog.org?129 - I get an "insecure connection" message.
Can you tell me what I'm doing wrong? It is like it looks for the certificate before doing the redirect.
I'm trying to use a .htaccess redirect so that both are accomplished in one pass. I've tried a few different things and none work.
The most recent was:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://chloedog.org/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
With the above, the following happens:
http://www.chloedog.org?129 - Works Fine
http://chloedog.org?129 - works fine
https://chloedog.org?129 - works fine
https://www.chloedog.org?129 - I get an "insecure connection" message.
Can you tell me what I'm doing wrong? It is like it looks for the certificate before doing the redirect.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That is kind of what I thought... and makes sense. Thanks for the confirmation.
Open in new window