-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
45 lines (38 loc) · 1.4 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Options -Indexes
# Security Headers
Header always set Content-Security-Policy "frame-ancestors 'none'"
Header always set Referrer-Policy "no-referrer"
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "DENY"
Header always set X-XSS-Protection "1; mode=block"
# cache images for 4 weeks
<FilesMatch "\.(gif|jpe?g|png|ico)$">
Header set Cache-Control: "max-age=2419200"
</FilesMatch>
# cache scripts, CSS For 1 week
<FilesMatch "\.(js|css)$">
Header set Cache-Control: "max-age=604800"
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect to HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
<ifModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 1 weeks"
ExpiresByType image/jpg "access plus 1 weeks"
ExpiresByType image/jpeg "access plus 1 weeks"
ExpiresByType image/png "access plus 1 weeks"
ExpiresByType image/vnd.microsoft.icon "access plus 1 weeks"
ExpiresByType image/x-icon "access plus 1 weeks"
ExpiresByType image/ico "access plus 1 weeks"
ExpiresByType application/javascript "now plus 1 weeks"
ExpiresByType application/x-javascript "now plus 1 weeks"
ExpiresByType text/javascript "now plus 1 weeks"
ExpiresByType text/css "now plus 1 weeks"
ExpiresDefault "access plus 1 days"
</ifModule>