Skip to content

Instantly share code, notes, and snippets.

@stammy
Forked from henrik/.htaccess
Created December 31, 2010 04:28

Revisions

  1. @henrik henrik revised this gist Apr 18, 2009. 2 changed files with 4 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions .htaccess
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,5 @@
    RewriteEngine On

    # Disable auto-adding slashes to directories without them, since this happens
    # after mod_rewrite and exposes the rewritten internal URL, e.g. turning
    # http://henrik.nyh.se/about into http://henrik.nyh.se/jekyll/about.
    DirectorySlash off

    # Map http://henrik.nyh.se to /jekyll.
    RewriteRule ^$ /jekyll/ [L]

    4 changes: 4 additions & 0 deletions jekyll/.htaccess
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # Disable auto-adding slashes to directories without them, since this happens
    # after mod_rewrite and exposes the rewritten internal URL, e.g. turning
    # http://henrik.nyh.se/about into http://henrik.nyh.se/jekyll/about.
    DirectorySlash off
  2. @henrik henrik created this gist Apr 18, 2009.
    21 changes: 21 additions & 0 deletions .htaccess
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    RewriteEngine On

    # Disable auto-adding slashes to directories without them, since this happens
    # after mod_rewrite and exposes the rewritten internal URL, e.g. turning
    # http://henrik.nyh.se/about into http://henrik.nyh.se/jekyll/about.
    DirectorySlash off

    # Map http://henrik.nyh.se to /jekyll.
    RewriteRule ^$ /jekyll/ [L]

    # Map http://henrik.nyh.se/x to /jekyll/x unless there is a x in the web root.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/jekyll/
    RewriteRule ^(.*)$ /jekyll/$1

    # 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/