Dynamic VirtualHost using mod_vhost_alias
I was looking into a solution for a customer and mod_vhost_alias came in handy. Lets say you want to host blogs for several people and you want to host them on the following subdomain format: blogname.crazyblogs.com. Instead of having a separate virtual host for each one, you can do something like this: Now, if you go to http://blog1.crazyblogs.com, it will look for a index file inside /var/www/blog1.crazyblogs.com/htdocs. You can find further information on:
UseCanonicalName Off
VirtualDocumentRoot /var/www/%0/htdocs
ServerName *.crazyblogs.com
0 comments:
Post a Comment