-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
31 lines (25 loc) · 874 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
28
29
30
31
RewriteEngine On
# Common errors
RewriteRule ^ga.js$ / [R=404,L,NC]
# Jekyll: home page
RewriteCond %{REQUEST_URI} ^index\.html$ [NC]
RewriteRule . / [R=301,L,NC]
# Jekyll: demo page
RewriteCond %{REQUEST_URI} ^demos/ [NC]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]
# Jekyll: tags page
RewriteCond %{REQUEST_URI} ^tag/(index\.html)?$ [NC]
RewriteRule . /tag [R=301,L,NC]
RewriteRule ^tag$ /tag/index.html [L,NC]
# Jekyll: tag page
RewriteCond %{REQUEST_URI} ^tag/[^/]+/(index\.html)?$ [NC]
RewriteRule ^(tag/[^/]+)/index\.html$ $1 [R=301,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^tag/([^/]+)$ /tag/$1/index.html [L,NC]
# Jekyll: post page
RewriteCond %{REQUEST_URI} ^[^/]+(/|\.html)$ [NC]
RewriteRule ^([^/]+)\.html$ $1 [R=301,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ $1\.html [L,NC]