force from https://www to https
-
Hi everyone,
I hope someone can help me and I’m not in the wrong place.
I recently moved hosts and my old host had the default domian as https://www. Since moving to Godaddy it’s been switched to https. I have redirects in the .htaccess file to point to the non www version, but whenever someone visits the https://www version the site is broken and doesn’t load the css. The weird thing is if you refresh the page it loads correctly.
I’ve switched the preferred domain in Webmaster tools to the https version, but the https:///www. is still causing problems.
At the top of the .htaccess I have this
RewriteEngine On # match any URL with www and rewrite it to https without the www RewriteCond %{HTTP_HOST} ^(www\.)(.*) [NC] RewriteRule (.*) https://%2%{REQUEST_URI} [L,R=301] # match urls that are non https (without the www) RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} !^(www\.)(.*) [NC] RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
What am I doing wrong? It works, but only on a refresh. I don’t want to drive customers away with an ugly broken site.
- The topic ‘force from https://www to https’ is closed to new replies.