-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
134 lines (118 loc) · 4.82 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# AddType TYPE/SUBTYPE EXTENSION
# media types
AddType audio/mpeg mp3
AddType audio/ogg ogg
AddType audio/ogg oga
AddType application/x-shockwave-flash swf
# fonts types
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
AddType image/svg+xml .svg
# allow access to everyone
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
# use utf-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
# You can add custom pages to handle 500 or 403 pretty easily, if you like.
ErrorDocument 404 /404.html
# Rewrite "www.domain.com -> domain.com"
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>
####### This has commented out, because this is beta release and not final yet.. else this caching is must for need for speed.
#header expires
<IfModule mod_expires.c>
## ExpiresActive on
##
## # Perhaps better to whitelist expires rules? Perhaps.
## ExpiresDefault "access plus 1 month"
##
## # cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
## ExpiresByType text/cache-manifest "access plus 0 seconds"
##
## # your document html
## ExpiresByType text/html "access plus 1 week"
##
## # data
## #ExpiresByType text/xml "access plus 0 seconds"
## #ExpiresByType application/xml "access plus 0 seconds"
## #ExpiresByType application/json "access plus 0 seconds"
##
## # rss feed
## #ExpiresByType application/rss+xml "access plus 1 hour"
##
## # favicon (cannot be renamed)
## ExpiresByType image/x-icon "access plus 1 year"
##
## # media: images, video, audio, pdf
## ExpiresByType image/gif "access plus 1 year"
## ExpiresByType image/png "access plus 1 year"
## ExpiresByType image/jpg "access plus 1 year"
## ExpiresByType image/jpeg "access plus 1 year"
## ExpiresByType audio/mpeg "access plus 1 year"
## ExpiresByType audio/ogg "access plus 1 year"
## ExpiresByType application/pdf "access plus 1 year"
## ExpiresByType application/x-shockwave-flash "access plus 1 year"
##
## # htc files (css3pie)
## ExpiresByType text/x-component "access plus 1 year"
##
## # webfonts
## ExpiresByType font/truetype "access plus 1 year"
## ExpiresByType font/opentype "access plus 1 year"
## ExpiresByType application/x-font-woff "access plus 1 year"
## ExpiresByType image/svg+xml "access plus 1 year"
## ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
##
## # css and javascript
## ExpiresByType text/css "access plus 1 year"
## ExpiresByType application/javascript "access plus 1 year"
## ExpiresByType application/x-javascript "access plus 1 year"
## ExpiresByType text/javascript "access plus 1 year"
##
## <IfModule mod_headers.c>
## Header append Cache-Control "public"
## </IfModule>
</IfModule>
# ----------------------------------------------------------------------
# ETag removal
# ----------------------------------------------------------------------
# Since we're sending far-future expires, we don't need ETags for
# static content.
# developer.yahoo.com/performance/rules.html#etags
FileETag None
# ----------------------------------------------------------------------
# gzip compression
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
# force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# html, txt, css, js, json, xml, htc:
<IfModule filter_module>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
FilterChain COMPRESS
FilterProtocol COMPRESS change=yes;byteranges=no
</IfModule>
<IfModule !mod_filter.c>
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
</IfModule>
# webfonts and svg:
<FilesMatch "\.(ttf|otf|eot|svg)$" >
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>