-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.htaccess
52 lines (45 loc) · 1.67 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
ErrorDocument 404 /404.html
# Safe-guarding the .htaccess file
<Files .htaccess>
order deny,allow
deny from all
</Files>
# Setting custom headers for a few files
<FilesMatch "\.(flv|swf|mp3|ico|pdf|flv|jpg|jpeg|png|gif|js|css|ttf|eot|svg)$">
Header unset Pragma
FileETag None
Header unset ETag
Header unset P3P
</FilesMatch>
# Compression using deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
<FilesMatch "\\.(js|css|html|htm|php|xml|txt|otf|eot)$">
SetOutputFilter DEFLATE
</FilesMatch>
# Gzips content if possible
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl|otf|eot)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text\.*
mod_gzip_item_include mime ^application/x-javascript$
mod_gzip_item_include mime ^application/json$
mod_gzip_item_include mime ^application/vnd.ms-fontobject$
# There is no content-type for OTF yet, so we can get away by just
# listing the extension in the mod_gzip_item include file listing.
# For the sake of being good I have added the vendor-specific
# IANA content-type for EOT.
mod_gzip_item_exclude mime ^image\.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
mod_gzip_send_vary On
</IfModule>
# Cache following file types for one month
<FilesMatch ".(js|css|jpeg|jpg|png|otf|eot)$">
Header set Cache-Control "max-age=2592000"
</FilesMatch>
# Blocks font hotlinking
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?klepas.org/.*$ [NC]
RewriteRule \.(otf|eot)$ - [F,NC,L]