Coding for PHP on Mac OSX Lion, using the following within the httpd.conf file:
<VirtualHost *:80>
DocumentRoot /Users/user/Sites/wordpress
ServerName wordpress.local
<Directory “/Users/user/Sites/wordpress">
AllowOverride All
Options All
</Directory>
</VirtualHost>
and in the hosts file:
127.0.0.1 wordpress.local
This all works fine. What I want to be able to do is allow that first section to accept some sort of wildcard so that I can add several pages to the hosts file, but not have to keep messing with the httpd.conf file. I used to be able to use %1 and %0 instead of the directory name to get this working, but there now seems to be a problem with that.
All help much appreciated.
Cheers,
David.
The following blogpost by Rob Allen should help, I think : Automatic Apache vhosts
The first part of the article is about
mod_vhost_alias, which will allow you to use wildcards forServerAlias, aVirtualDocumentRootdirective it adds, andDirectory.