2
0
mirror of https://github.com/phanan/htaccess.git synced 2018-11-08 13:39:40 +01:00

Made some amends for #48

This commit is contained in:
An Phan 2015-02-25 23:52:43 +08:00
parent d34ec0cde0
commit 7b8da8b3f3

View File

@ -89,7 +89,16 @@ RewriteRule ^ %1%3%{REQUEST_URI} [R=301,L]
### Force HTTPS
``` apacheconf
Header always set Strict-Transport-Security "max-age=604800; includeSubDomains"
RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# Note: It's also recommended to enable HTTP Strict Transport Security (HSTS)
# on your HTTPS website to help prevent man-in-the-middle attacks.
# See https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>
```
### Force HTTPS Behind a Proxy