Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
226 | daniel-mar | 1 | # https://stackoverflow.com/a/26155051/488539 |
2 | |||
3 | # Redirect to HTTPS |
||
4 | RewriteEngine on |
||
5 | RewriteCond %{HTTPS} off |
||
6 | RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L] |
||
7 | |||
8 | # Authenticate users only when using HTTPS |
||
9 | <If "%{HTTPS} == 'on'"> |
||
10 | AuthType Basic |
||
11 | AuthName "ViaThinkSoft" |
||
12 | AuthUserFile /home/daniel-marschall/.htpasswd |
||
13 | # Prevent this 'Require' directive from overriding any merged previously |
||
14 | <IfVersion >= 2.4> |
||
15 | AuthMerging And |
||
16 | </IfVersion> |
||
17 | Require valid-user |
||
18 | </If> |
||
19 | |||
20 | # --- |
||
21 | |||
22 | RewriteEngine Off |
||
23 | RewriteOptions Inherit |
||
24 | Options +Indexes |
||
25 |