Skip to content

Instantly share code, notes, and snippets.

@ahonymous
Created June 9, 2017 12:45
Show Gist options
  • Save ahonymous/c9c96c7fac48fb089a4d7484a0cb82a4 to your computer and use it in GitHub Desktop.
Save ahonymous/c9c96c7fac48fb089a4d7484a0cb82a4 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
ServerAdmin ahonymous@gmail.com
DocumentRoot "/Users/ahonymous/work/symfony/trip/web"
ServerName trip.alex.ekreative.com
ErrorLog "/private/var/log/apache2/trip-error_log"
CustomLog "/private/var/log/apache2/trip-access_log" common
<Directory "/Users/ahonymous/work/symfony/trip/web">
Options All
AllowOverride None
Require all granted
DirectoryIndex app.php
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteRule ^ %{ENV:BASE}/app.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /app.php/
</IfModule>
</IfModule>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment