-
Notifications
You must be signed in to change notification settings - Fork 48
/
.htaccess
56 lines (56 loc) · 1.89 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
48
49
50
51
52
53
54
55
56
# fonts declaration
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
# compress text, html, javascript, css, xml:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
#Browser cache
<IfModule mod_expires.c>
<FilesMatch "\.(jpe?g|png|gif|js|css|ttf|svg|woff?2)$">
ExpiresActive On
ExpiresDefault "access plus 7 days"
</FilesMatch>
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType application/x-javascript "access plus 7 days"
ExpiresByType application/javascript "access plus 7 days"
ExpiresByType text/javascript "access plus 7 days"
ExpiresByType text/js "access plus 7 days"
</IfModule>
#Security
Options All -Indexes
<FilesMatch "^(readme.*|license.*|composer.*|wp-config.php|README.*|package(-lock)?.*)$">
order allow,deny
deny from all
</FilesMatch>
<FilesMatch ".+\.ph(p[345]?|t|tml|x|.\..*|)$" >
order allow,deny
deny from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^build/* - [R=403]
RewriteRule ^config/* - [R=403]
RewriteRule ^src/* - [R=403]
RewriteRule ^test/* - [R=403]
RewriteRule ^static/* - [R=403]
RewriteRule ^node_modules/* - [R=403]
RewriteRule ^vendor(/|$) - [F]
RewriteRule ^(^\.|\/\.) /index.html [R=404]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [R=404]
</IfModule>