I am trying to force a subfolder (/bbb/) of my root domain to show always as https. Also my .htaccess
file take care of the extensions of the pages.
I have
Problem is in this rule:
#Force from http to https
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} !^bbb.example.co.uk/$
RewriteRule ^(.*)$ https://bbb.example.co.uk/$1 [R=301]
Change this rule to:
#Force from http to https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} =bbb.example.co.uk
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301]
You have condition reversed due to use of !
at start and have an extra slash at end which will never be matched hence making your condition always return true.
Make sure to clear your browser cache before testing this.