apache virtual host definition with regex
问题 For development projects I point real domains to localhost using hosts file. and I add virtual host definition to apache config file. My question is it possible to redirect all "xyz.com" domains to "d:/xampp/htdocs/websites/xyz.com" directory ? this way I will not need to add vhost definition everytime. 回答1: You can use a wildcard in your VirtualHost 's ServerAlias directive: <VirtualHost *:80> # Official name is example.com ServerName example.com # Any subdomain *.example.com also goes here