This repository has been archived by the owner on Jun 7, 2019. It is now read-only.
/
.htaccess
61 lines (52 loc) · 1.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
# Migrated from `date` to `pretty` permalink structure.
RewriteEngine On
# Directory index is never accessible.
#
# /index.html -> /
# /foo/index.html -> /foo/
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} ^\/.*index\.html$
RewriteRule ^(.*)index.html$ http://robbie.io/$1 [R=301,L]
# Continue to support deprecated permalink structure.
#
# /2009/09/09/foo.html -> /2009/09/09/foo/
RewriteCond %{REQUEST_URI} \/\d{4}\/\d{2}\/\d{2}\/.+\.html$
RewriteRule (.+).html$ http://robbie.io/$1/ [R=301,L]
# Append trailing slash to directories.
# Borrowed from http://gist.github.com/97822
#
# /foo -> /foo/
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} !/$
RewriteRule ^(.*)$ http://robbie.io/$1/ [R=301,L]
# Compress static assets
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Set Expires Headers
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Jan 2015 20:00:00 GMT"
</FilesMatch>
# Set the cache-control max-age
# 1 year
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=31449600, public"
</FilesMatch>
# 2 DAYS
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>
# 4 HOURS
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=14400, must-revalidate"
</FilesMatch>
# Pretty error page
ErrorDocument 404 http://robbie.io/404-not-found.html
# Mime types
AddType application/x-woff woff