Skip to content

Instantly share code, notes, and snippets.

@myles
Created May 2, 2013 15:33
Show Gist options
  • Save myles/5503047 to your computer and use it in GitHub Desktop.
Save myles/5503047 to your computer and use it in GitHub Desktop.
Rewrite a root directory to a subdirectory (i.e. /index.html -> /subdir/index.html).
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/subdir
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ subdir/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment