web:password-protected:force_https
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
web:password-protected:force_https [2017/12/20 09:30] – created jas | web:password-protected:force_https [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Forcing Page Access to https:// ====== | ||
- | |||
- | If your web page is requesting a password, it is best to send the password over an encrypted channel. | ||
- | |||
- | Before your authentication block, add this code to redirect http://URL to https:// | ||
- | |||
- | < | ||
- | RewriteEngine On | ||
- | RewriteCond %{HTTPS} off | ||
- | RewriteRule ^/?(.*) https:// | ||
- | </ | ||
- | |||
- | Surrounding your authentication block, add this condition which forces authentication to only occur when your page is served over https: | ||
- | |||
- | < | ||
- | <If " | ||
- | <Your authentication block> | ||
- | </If> | ||
- | </ | ||
- | |||
- | That's all you need to do! Putting it together, here's an example: | ||
- | |||
- | < | ||
- | RewriteEngine On | ||
- | RewriteCond %{HTTPS} off | ||
- | RewriteRule ^/?(.*) https:// | ||
- | |||
- | <If " | ||
- | AuthType Basic | ||
- | AuthName "My Page" | ||
- | AuthBasicProvider pam | ||
- | require valid-user | ||
- | </If> | ||
- | </ | ||
web/password-protected/force_https.1513780248.txt.gz · Last modified: 2017/12/20 09:30 by jas