-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
27 lines (20 loc) · 841 Bytes
/
.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
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
# example.com/page will display the contents of example.com/page.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
# Disallow font hotlinking
RewriteCond %{HTTP:Origin} !^$|http(s)?://(www\.)?michaelhemingway\.com$ [NC]
RewriteRule \.(woff|woff2|ttf|eot)$ - [NC,L]
RewriteCond %{HTTP_REFERER} !.
RewriteRule \.(woff|woff2|ttf|eot)$ - [F,NC,L]
# 301 from example.com/page.html to example.com/page
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
# 1 Month for most static assets
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico|woff)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
ErrorDocument 404 /404.html