.htaccess https rewrite for single domain on multisite installation I have a multisite installation with 2 sites running off separate domains. One of these sites needs to go through https:// while the the other can stick to http://. I also want all traffic to be rewritten to include the www. prefix.

So:

example.com rewritten to https://www.example.com

example.co.uk rewritten to http://www.example.co.uk

I'm trying to set my .htaccess file to handle this, and have tried with the  syntax discussed here.

RewriteEngine on
&lt;If "%{HTTP_HOST} == 'example.com'"&gt;
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
&lt;/If&gt;
&lt;If "%{HTTP_HOST} == 'example.co.uk'"&gt;
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !http
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
&lt;/If&gt;


Needless to say, it's not working. Any input would be much appreciated!
First I would try using the [drupal]/sites/sites.php file to do something like this:

$sites['example.co.uk'] = 'example.com';
$sites['example.com'] = 'example.com'; // for demonstration only


Then check out the htaccess module to force HTTPS. These are the  options: