-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
74 lines (65 loc) · 1.78 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
#
# Protect .htaccess file
#
<files .htaccess>
order allow,deny
deny from all
</files>
#
# Disable directory browsing
#
Options All -Indexes
# TIP: check out these header settings with curl -I <url> (fetches headers only).
#
# This section sets up the cacheing for various types of files (in secs).
# http://www.askapache.com/hacking/speed-site-caching-cache-control.html
#
# # 480 weeks
# <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
# Header set Cache-Control "max-age=290304000, public"
# </filesMatch>
#
# # 2 DAYS
# <filesMatch "\.(xml|txt)$">
# Header set Cache-Control "max-age=172800, public, must-revalidate"
# </filesMatch>
#
# # 2 HOURS = 60*60*2 = 7200
# # 1 MINUTE = 60
# <filesMatch "\.(html|htm|appcache)$">
# Header set Cache-Control "max-age=60, must-revalidate"
# </filesMatch>
#
# Remove ETags to improve performance
# http://developer.yahoo.com/performance/rules.html#etags
#
FileETag none
# 404 page
ErrorDocument 404 /404.html
<IfModule mod_gzip.c>
Header add X-Enabled mod_gzip
</IfModule>
<IfModule mod_deflate.c>
Header add X-Enabled mod_deflate
</IfModule>
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/html
#
# WordPress - redirect everything (that doesn’t exist) to index.php
#
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteBase /
# RewriteRule ^index\.php$ - [L]
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule . /index.php [L]
# </IfModule>
#
# Disable hotlinking of images and replace them with error image
#
# RewriteEngine on
# RewriteCond %{HTTP_REFERER} !^$
# RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
# RewriteRule \.(gif|jpg|png)$ – [F]
# RewriteRule \.(gif|jpg|png)$ http://www.yourdomain.com/error_image.gif [R,L]