Skip to content

Instantly share code, notes, and snippets.

@icco
Forked from henrik/.htaccess
Created December 21, 2009 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icco/260847 to your computer and use it in GitHub Desktop.
Save icco/260847 to your computer and use it in GitHub Desktop.
pseudoweb.net .htaccess
RewriteEngine On
# Map / to /_site.
RewriteRule ^$ /_site/ [L]
# Map /x to /_site/x
RewriteCond %{REQUEST_URI} !^/_site/
RewriteRule ^(.*)$ /_site/$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/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment