-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
47 lines (37 loc) · 1.54 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
46
47
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.html -f
RewriteRule ^(.+?)/?$ $1.html [NC,L]
ErrorDocument 404 /404.html
# Security headers
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header always append Content-Security-Policy "frame-ancestors 'self' https://youtu.be https://w.soundcloud.com;"
Header set X-Content-Type-Options "nosniff"
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
Header set Referrer-Policy "same-origin"
Header set Permissions-Policy geolocation=(self)
</IfModule>
# Browser caching
<IfModule mod_expires.c>
ExpiresActive on
# Favicon and cursor images
ExpiresByType image/x-icon "access plus 4 month"
# Media
ExpiresByType image/png "access plus 4 month"
ExpiresByType image/webp "access plus 4 month"
ExpiresByType image/avif "access plus 4 month"
ExpiresByType image/svg "access plus 4 month"
# CSS
ExpiresByType text/css "access plus 4 month"
# JavaScript
ExpiresByType text/javascript "access plus 4 month"
ExpiresByType application/javascript "access plus 4 month"
# Web fonts
ExpiresByType application/font-woff2 "access plus 4 month"
ExpiresByType font/woff2 "access plus 4 month"
ExpiresByType image/svg+xml "access plus 4 month"
</IfModule>