Skip to content

Instantly share code, notes, and snippets.

@mikaelz
Created June 20, 2016 12:58
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 mikaelz/e89e848d0cee2d9092e4ef4f403e5755 to your computer and use it in GitHub Desktop.
Save mikaelz/e89e848d0cee2d9092e4ef4f403e5755 to your computer and use it in GitHub Desktop.
Change Apache document root with htaccess. Just symlink current to release directory that you want to serve
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !current/
RewriteRule (.*) /current/$1 [L]
# http://localhost/example.com
# RewriteRule (.*) /example.com/current/$1 [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment