I'm looking to redirect all of:
http://
http://www.
https://www.
to https://
This may have been answered here before, but having gone through the questions that seem relevant they are all not quite what I'm after, and everything I've tried resulted in a redirect loop or not working as hoped.
For example:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www.example.com
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
RewriteCond %{HTTPS_HOST} ^example.com
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
Thanks in advance for your help.
Try:
RewriteCond %{HTTP_HOST} !^energenie4u\.co\.uk$ [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://energenie4u.co.uk/$1 [R=301,L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With