-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
26 lines (21 loc) · 1001 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
RewriteEngine On
# Map http://joshuacody.net to /site/blog.html.
RewriteRule ^$ /site/_site/blog.html [L]
# Map http://joshuacody.net/xyz to /site/xyz unless there is an x in the web root.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/site/_site/%{REQUEST_URI}\.html !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/site/_site/
RewriteRule ^(.*)$ /site/_site/$1
# Allow access without .html extension
RewriteCond %{DOCUMENT_ROOT}/site/_site/%{REQUEST_URI}\.html -f
RewriteRule ^(.*)$ /site/_site/$1\.html
# Add trailing slash to directories without them so DirectoryIndex works.
# This does not expose the internal URL.
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_FILENAME} !/$
RewriteRule ^(.*)$ $1/
# Disable auto-adding slashes to directories without them, since this happens
# after mod_rewrite and exposes the rewritten internal URL, e.g. turning
# http://www.example.com/about into http://www.example.com/jekyll/about.
DirectorySlash off