Skip to content

Instantly share code, notes, and snippets.

@imiroslavov
Created November 14, 2019 11:58
Show Gist options
  • Save imiroslavov/f70f8ec6c2e6613f2fbc7c64819715d5 to your computer and use it in GitHub Desktop.
Save imiroslavov/f70f8ec6c2e6613f2fbc7c64819715d5 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
ServerName hostname
DocumentRoot /path/to/web
DirectoryIndex app.php
<Directory /path/to/web>
Require all granted
AllowOverride None
</Directory>
<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 %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteRule .? %{ENV:BASE}/app.php [L]
</IfModule>
</VirtualHost>
@AntonioCS
Copy link

Saved the day for me today! Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment