Skip to content

Instantly share code, notes, and snippets.

@simodima
Last active December 19, 2015 13:59
Show Gist options
  • Save simodima/5966281 to your computer and use it in GitHub Desktop.
Save simodima/5966281 to your computer and use it in GitHub Desktop.
Symfony2 virtualhost
<VirtualHost *:80>
DocumentRoot /path/to/symfony/web
ServerName booking.local
<Directory /path/to/symfony/web >
Options FollowSymLinks
AllowOverride All
Allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app_\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule .? %{ENV:BASE}/app_dev.php [L]
</IfModule>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment