-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.htaccess
60 lines (51 loc) · 1.88 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
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
# compress with MOD_DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml text/javascript application/x-javascript application/javascript application/x-httpd-php
# proxies should not decompress for the user
Header append Vary User-Agent env=!dont-vary
<IfModule mod_headers.c>
# Cache images and other static files for 1 month
<FilesMatch ".(ico|jpe?g|png|gif|css|js|gz)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
# Cache html and xml for 12 hours
<filesMatch ".(html|htm|xml)$">
Header set Cache-Control "max-age=43200"
</filesMatch>
# do NOT cache php and cgi files
<FilesMatch ".(php)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
</IfModule>
# END Expire headers
Header unset ETag
FileETag none
# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>
# forbid directory listing
Options -Indexes