Hacks:Engine:Subdomains as a main domains of user

From VHCP Support

Jump to: navigation, search

If you want to assing a subdomain of your earlier domain (for e.g. domain.tld) in your system to new users, add a new user with subdomain (like subdomain.domain.tld). You need to edit few template files of your VHCP system to allow this to work.


Open /etc/vhcp/apache/parts and edit files als_entry.tpl, dmn_entry.tpl and sub_entry.tpl.

Look for following line, that looks like (example for dmn_entry.tpl):

ServerAlias     www.{DMN_NAME} {DMN_NAME} *.{DMN_NAME}

And change it to:

ServerAlias     www.{DMN_NAME} {DMN_NAME}

(Removes *.{DMN_NAME}, same in other files - remove *.{SUB_NAME}, *.{ALS_NAME})

Now subdomain shouldn't point to main domain anymore and users with subdomains as domain names works!

Personal tools