-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
executable file
·102 lines (81 loc) · 2.61 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#Rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine on
Options -Multiviews
Options +FollowSymlinks +SymLinksIfOwnerMatch
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_URI} !index\.php
RewriteRule . index.php [L,QSA]
</IfModule>
#Errors document
ErrorDocument 400 /error/400
ErrorDocument 401 /error/401
ErrorDocument 403 /error/403
ErrorDocument 404 /error/404
ErrorDocument 405 /error/405
ErrorDocument 500 /Merror/500
ErrorDocument 502 /error/502
ErrorDocument 503 /error/503
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Caching mod_headers + mod_expires
<ifModule mod_expires.c>
# Turn on Expires and set default to now
ExpiresActive On
ExpiresDefault "now"
# Set up caching on media files for 1 month
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|swf)$">
ExpiresDefault "access plus 1 month"
</FilesMatch>
# Set up caching on images, CSS and JS files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|js|css)$">
ExpiresDefault "access plus 1 week"
</FilesMatch>
# Set up 1 hour caching on commonly updated files
<FilesMatch "\.(xml|xsl|html|htm|txt)$">
ExpiresDefault "access plus 1 hour"
</FilesMatch>
# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl)$">
ExpiresActive Off
</FilesMatch>
</IfModule>
<IfModule mod_headers.c>
# Remote ETag from headers
Header unset ETag
# Disable ETag for files
FileETag None
# Media files are catchable
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|swf)$">
Header append Cache-Control "public"
</FilesMatch>
# Images, css and javascript files are catchable
<FilesMatch "\.(gif|jpg|jpeg|png|js|css)$">
Header append Cache-Control "public"
</FilesMatch>
# Commonly updated files are catchable
<FilesMatch "\.(xml|html|htm|txt)$">
Header append Cache-Control "public"
</FilesMatch>
# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
</IfModule>
# Compressing mod_gzip
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>