This repository has been archived by the owner on Jan 4, 2021. It is now read-only.
forked from TryGhost/Casper
-
Notifications
You must be signed in to change notification settings - Fork 10
/
.htaccess
77 lines (77 loc) · 2.72 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
AddDefaultCharset utf-8
ErrorDocument 404 /404.html
Options All -Indexes
ServerSignature Off
#RewriteEngine On
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://blog.abr4xas.org/$1 [R,L]
Options +FollowSymlinks
FileETag None
RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)=http [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
# GZip Files
<FilesMatch "\.(htm|html|php|css|js)$">
AddHandler application/x-httpd-php .html
</FilesMatch>
<FilesMatch "\.(htm|html|php|xml|css|js)$">
SetOutputFilter DEFLATE
</FilesMatch>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json text/xml application/xml
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript text/x-component
SetOutputFilter DEFLATE
</IfModule>
#
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault A0
ExpiresByType text/cache-manifest A2592000
ExpiresByType text/html A2592000
ExpiresByType text/xml A2592000
ExpiresByType application/xml A2592000
ExpiresByType application/json A2592000
ExpiresByType application/rss+xml A2592000
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/x-javascript "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
# A2592000 means 1 month in the future (60*60*24*30=2592000)
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
<IfModule mod_headers.c>
#KeepAlive On
Header set Connection keep-alive
ExpiresActive On
ExpiresDefault A0
# YEAR
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf|js|css|swf|xml|mp3)$">
Header set Cache-Control "max-age=29030400"
ExpiresDefault A29030400
Header append Cache-Control "public"
RequestHeader unset Cookie
Header always unset Set-Cookie
Header unset ETag
</FilesMatch>
# 10 min
<FilesMatch "\.(html|htm|txt|php)$">
Header set Cache-Control "max-age=2700"
Header append Cache-Control "public, must-revalidate"
ExpiresDefault A600
</FilesMatch>
</IfModule>
SetEnv SERVER_ADMIN [email protected]