RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.domain\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^https://www\.domain\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ [OR]
RewriteRule ^(.*)$ httpss://www.domain.co.uk/$1 [R=301,L]
# Force all traffic onto one domain with www (will redirect all aliases)
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.your_domain.com$
RewriteRule ^(.*)$ https://www.your_domain.com/$1 [R=301]
RewriteCond %{REQUEST_URI} !^/(foldername|foldername/.*)$
Example from WordPress rewrite rules:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(foldername|foldername/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]