This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
60 lines (51 loc) · 1.84 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
57
58
59
60
AddDefaultCharset utf-8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
RewriteRule \.(css|jpg|jpeg|wbmp|bmp|tiff|raw|png|gif)$- [NC,F,L]
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg 'access 1 year'
ExpiresByType image/bmp 'access 1 year'
ExpiresByType image/raw 'access 1 year'
ExpiresByType image/gif 'access 1 year'
ExpiresByType image/png 'access 1 year'
ExpiresByType image/tiff 'access 1 year'
ExpiresByType image/wbmp 'access 1 year'
ExpiresByType image/jpeg 'access 1 year'
ExpiresByType text/css 'access 1 month'
ExpiresByType text/html 'access 1 month'
ExpiresByType application/pdf 'access 1 month'
ExpiresByType text/x-javascript 'access 1 month'
ExpiresByType application/x-shockwave-flash 'access 1 month'
ExpiresByType image/x-icon 'access 1 year'
ExpiresDefault 'access 1 month'
</IfModule>
<filesMatch '.(css|js|html|jpg|png|gif|ico|webp|bmp|jpeg|)$'>
Header set Cache-Control 'max-age=2592000, public'
</filesMatch>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
<IfModule mod_headers.c>
RewriteCond '%{REQUEST_FILENAME}\.gz' -s
RewriteCond '%{HTTP:Accept-encoding}' 'gzip'
RewriteRule '^(.*)\.css' '$1\.css\.gz' [QSA]
RewriteCond '%{REQUEST_FILENAME}\.gz' -s
RewriteRule '^(.*)\.js' '$1\.js\.gz' [QSA]
RewriteCond '%{HTTP:Accept-encoding}' 'gzip'
RewriteRule '\.css\.gz$' '-' [T=text/css,E=no-gzip:1]
RewriteRule '\.js\.gz$' '-' [T=text/javascript,E=no-gzip:1]
<FilesMatch '(\.js\.gz|\.css\.gz)$'>
Header append Vary Accept-Encoding
Header append Content-Encoding gzip
</FilesMatch>
</IfModule>
<Files ~"\.(md|sh|env|ini|log|json|htaccess|htpasswd|gitignore|gitattributes|lock)$">
Order allow,deny
Deny from all
</Files>
Options -Indexes