RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] RewriteCond %{HTTP_HOST} ^MyWebsite\.biz$ [OR] RewriteCond %{HTTP_HOST} ^www\.MyWebsite\.biz$ RewriteRule ^/?$ "https\:\/\/www\.My\-Website\.com" [R=301,L] RewriteCond %{HTTP_HOST} ^MyWebsite\.co$ [OR] RewriteCond %{HTTP_HOST} ^www\.MyWebsite\.co$ RewriteRule ^/?$ "https\:\/\/www\.My\-Website\.com" [R=301,L] RewriteCond %{HTTP_HOST} ^MyWebsite\.net$ [OR] RewriteCond %{HTTP_HOST} ^www\.MyWebsite\.net$ RewriteRule ^/?$ "https\:\/\/www\.My\-Website\.com" [R=301,L] RewriteCond %{HTTP_HOST} ^MyWebsite\.us$ [OR] RewriteCond %{HTTP_HOST} ^www\.MyWebsite\.us$ RewriteRule ^/?$ "https\:\/\/www\.My\-Website\.com" [R=301,L] RewriteCond %{HTTP_HOST} ^MyWebsite\.info$ [OR] RewriteCond %{HTTP_HOST} ^www\.MyWebsite\.info$ RewriteRule ^/?$ "https\:\/\/www\.My\-Website\.com" [R=301,L]
RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your_domain.com$ RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]
This question has been answered by BobRay. See the first response.
RewriteRule (.*) https://yourdomain.com/$1 [R=301,L]
RewriteEngine On RewriteBase / # The Friendly URLs part RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] # Redirect to HTTPS without www RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
I think I actually found a working solution in the end:
# Redirect to HTTPS without www RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
Putting the last 5 lines of code *after* the friendly URLs part was the key I think.