Skip to content

Instantly share code, notes, and snippets.

@alpha1125
Created July 17, 2012 12:49
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 alpha1125/3129224 to your computer and use it in GitHub Desktop.
Save alpha1125/3129224 to your computer and use it in GitHub Desktop.
Directory tree structure:
.
└── hosts
├── project1
│   └── www
├── project2
│   └── www
├── project3
│   └── www
└── project4
   └── www
URL => correspondes to PATH
http://project1.localhost.com => ./hosts/project1/www
http://project2.localhost.com => ./hosts/project2/www
http://project3.localhost.com => ./hosts/project3/www
http://project4.localhost.com => ./hosts/project4/www
the vhost file is as follows:
==================================================================
Alias /phpmyadmin /opt/local/www/phpmyadmin
<directory "/opt/local/www/phpmyadmin">
RewriteEngine On
Options -Indexes FollowSymLinks
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</directory>
<directory "/www/hosts">
RewriteEngine On
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</directory>
UseCanonicalName Off
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon
RewriteEngine On
# include part of the server name in the filenames
VirtualDocumentRoot /www/hosts/%1/www
==================================================================
What's happening is I can't get the mod_rewrite to work...
If I do normal vhosts, instead of a mass vhost, the mod_rewrite works with the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment