I would like to have one single page mysubdir/checkout.php
to be secured using SSL.
e.g. https://www.mywebsite.com/fr/checkout
, where fr
is the language code.
All other pages should be redirected back to http.
This is what I have in .htaccess but it does not work.
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/fr/checkout
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/fr/checkout
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
##### Checkout #####
RewriteRule ^/(fr|en)/checkout/?$ mysubdir/checkout.php?lang=$1 [QSA]
However when I entered: https://www.mywebsite.com/fr/checkout
it redirects to https://www.mywebsite.com/mysubdir/checkout.php?lang=fr
. Why?
Any solution to this?