Last active
January 15, 2020 10:15
-
-
Save devcut/bb502c460526d733c5ba3deb3582d64d to your computer and use it in GitHub Desktop.
Dynamic vhosts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName localhost | |
DocumentRoot /Users/devcut/PhpstormProjects/ | |
VirtualDocumentRoot /Users/devcut/PhpstormProjects/%1/public | |
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 | |
<Directory "/Users/devcut/PhpstormProjects/*/public"> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
<IfModule mod_rewrite.c> | |
Options -MultiViews | |
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 ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L] | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule ^ - [L] | |
RewriteRule ^ %{ENV:BASE}/index.php [L] | |
</IfModule> | |
</Directory> | |
ErrorLog /var/log/apache2/s4_error.log | |
CustomLog /var/log/apache2/s4_access.log combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment