I am trying to use dynamically configured mass virtual hosting I added the following to httpd.conf: VirtualDocumentRoot /var/www/domains/%0 Requests to http://domain-name.com work fine, but www.domain-name.com results in 404 So I added this to httpd.conf: RewriteEngine On RewriteRule ^www.(.+)$ /var/www/domains/$1 Still not working. Any ideas how to fix ithe problem ? Thanks!
mod_vhost_alias is not particularly flexible and I've honestly never used it, but I'm reasonably certain you're going to have to use a different specifier at the end there. %0 means the entire name has to match. http://httpd.apache.org/docs/1.3/mod/mod_vhost_alias.html