Desired behavior:
Visiting http://www.example.com/our-services/individual-medical-dental-insurance
redirects to https: https://www.example.com/our-services/individual-medical-dental-insurance
Visiting any other page via https, such as https://www.example.com/about-group-benefit-services/
, redirects to non-https: http://www.example.com/about-group-benefit-services/
I've tried a variety of solutions, and this is my most recent version (which does not work):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} our-services/individual-medical-dental-insurance
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^our-services\/individual\-medical\-dental\-insurance
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}/$1
[L,R=301]
</IfModule>
It may be worth noting that this is in a WordPress site, and the remainder of the .htaccess file contains this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
(The .htaccess does not contain anything other than the above).