I'm trying to force a user to be redirected to the non-www website, and, force https.
I've got this which sort of work, but doesn't force https, when http is entered.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://site.com\.net/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
Any ideas on what I'm doing wrong?
https://www.mydomainname.co.uk
using the htaccess from the accepted answer above.http://mydomainname.co.uk
andhttp://www.mydomainname.co.uk
both redirect fine. My certificate was generated formydomainname.co.uk
. Any ideas (or any more information you need)? – Respire