Created
December 3, 2014 10:20
-
-
Save niklas-heer/f1392572c9f0469f2133 to your computer and use it in GitHub Desktop.
.htaccess file for jekyll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN Jekyll redirect | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
#this assumes you compiled your site to "/_site" | |
#Map http://www.example.com to /_site. | |
RewriteRule ^$ /_site/ [L] | |
#Map http://www.example.com/x to /_site/x unless there is a x in the web root. | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !^/_site/ | |
RewriteRule ^(.*)$ /_site/$1 | |
# Add trailing slash to directories within jekyll | |
# This does not expose the internal URL. | |
RewriteCond %{SCRIPT_FILENAME} -d | |
RewriteRule ^_site/(.*[^/])$ http://blog.niklas-heer.de/$1/ [R=301] | |
</IfModule> | |
# END Jekyll redirect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment