Seeking Wordpress-Apache conf that allows for dynamic subdir-to-site creation. Specifically, want to create any of these /var/www subdirs on the fly:
/var/www/main
/var/www/siterev1
/var/www/siterev2
and place a WordPress install in each one (easily done with git branches), and have above installs/dirs/sites map, respectively, to the following:
http://my.com/main
http://my.com/siterev1
http://my.com/siterev2
...all without any changes to Apache conf as subdirs are added. (eg: adding /var/www/siterev3 would enable http://my.com/siterev3 without any Apache conf changes.) This is a rather std config for Apache-to-dir path mapping, but can't get it to work, and am guessing the Apache mod_rewrite config (in Apache config below, comes form "std" WordPress install instructions) is not flexible enough.
Answers like this hard-code the site/path/subdir name in the Apache conf. Want to avoid this. Alternatively, if we must hard-code Apache conf, we'll go there (begrudgingly), but don't even know how to do that.
Current Apache config follows (running on Ubuntu 11.04 or above). Have tried a few tweaks gleaned from other posts/answers, but nothing's yet worked (and most configs appear to hard-code the subdir/site references).
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>