Reputation: 3486
How, in htaccess, can you force a URL to be HTTPS at the beginning even if it was specified at HTTP?
E.g. the follwoing urls
/subscribe/spanish
/subscribe/english
I'm assumming there is some kind of regex that can be used with /subscribe at the start?
Upvotes: 0
Views: 58
Reputation: 785128
Yes, you can use following rule:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^subscribe/ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE,NC]
This will force https if:
/subscribe/
Upvotes: 1