问题
I am trying to force one page to always use https it is not working
The url http://www.example.com/bookings/
and the .htaccess that I have
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^bookings$ https://www.example.com/bookings [L,R=301]
回答1:
Try this rule as your very first rule in your root .htaccess
:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^bookings/?$ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L,NE,NC]
来源:https://stackoverflow.com/questions/27530010/force-one-page-to-use-https-and-the-others-to-use-http-with-htaccess