views:

234

answers:

1

Is there a way to use this, or something like it, for SSL enabled hosts?

VirtualDocumentRoot /www/vhosts/%0/public

I want to avoid having to configure Apache every time I start working with a new domain on my development box. It would be nice to just add a directory, follow standard naming conventions, and be able to automatically access the site with HTTP or HTTPS.

I realize this definitely isn't the route to go for a production server, but it should be ok just for development.

One example came pretty close using mod_rewrite, but it still requires updating a configuration mapping file when you add a host (which I'm trying to avoid). http://sweon.net/2008/01/hosting-multiple-ssl-vhosts-on-a-single-ipportcertificate-with-apache2.

Any ideas?

Thanks

A: 

The author of the article I referenced above was nice enough to come up with a solution.

This is working on Apache 2.2:

RewriteRule ^/(.*)$ /var/www/%{HTTP_HOST}/htdocs/$1 [E=VHOST:${lowercase:%{HTTP_HOST}}]