-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.htaccess
94 lines (68 loc) · 3.39 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
# ----------------------------------------------------------------------
# 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*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# Compress all output labeled with one of the following MIME-types
# (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
# and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines as
# `AddOutputFilterByType` is still in the core directives)
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/rss+xml \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/xhtml+xml \
application/xml \
font/opentype \
image/svg+xml \
image/x-icon \
text/css \
text/html \
text/plain \
text/x-component \
text/xml
</IfModule>
</IfModule>
# ----------------------------------------------------------------------
# application cache
# ----------------------------------------------------------------------
AddType text/cache-manifest appcache
<Files ~ "\.appcache">
ExpiresActive On
ExpiresDefault "access"
</Files>
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# this is only a start. uncomment these and add more when go to production.
<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 (thanks Remy ~Introducing HTML5)
# ExpiresByType text/cache-manifest "access plus 0 seconds"
# Your document html
# ExpiresByType text/html "access plus 0 seconds"
# Favicon (cannot be renamed)
# ExpiresByType image/x-icon "access plus 1 week"
# CSS and JavaScript
# ExpiresByType application/javascript "access plus 1 year"
# ExpiresByType text/css "access plus 1 year"
</IfModule>
# ----------------------------------------------------------------------
# make sure we are utf-8 only
# ----------------------------------------------------------------------
AddDefaultCharset utf-8
AddCharset utf-8 .html .css .js .svg
# ----------------------------------------------------------------------
# see much more at https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess
# ----------------------------------------------------------------------