I know this question has been asked and answered many times but I've spent the last 3 hours going through peoples answers and none have seemed to work just right for me.
I need some .htaccess
code to do this:
If domain is example.co.uk/$urlData
(only apply to main domain and no subdomains) rewrite too www.example.co.uk/$urlData
If HTTPS is not "on" and domain is primary (ie. no subdomains) then redirect to https://www.example.co.uk/$urlData
.
I have to use RewriteCond %{HTTP:X-Forwarded-Proto} !https
to test if HTTPS is off as RewriteCond %{HTTPS} off
is not configured on my server.