ServerAlias using wildcard done right

bigolo

Member
Dec 5, 2004
8
0
151
I've read a lot of posts on this issue, but I still can't seem to find the correct way.

I need to add a wildcard for the ServerAlias for some users and I don't want to worry that the some point my change will be overwritten by some script. So if possible, can someone from cPanel staff please provide clear instructions on what needs to be done?

There is no such option in cPanel interface. I understand one option is to edit /var/cpanel/userdata/*/domain.com and add the wildcard there, but apparently this file is overwritten with the next build.

Thank you very much for your time.
 

cPanelJackson

Release Manager
Staff member
Aug 12, 2010
42
11
133
cPanel Access Level
Root Administrator
I am not aware of a specific process that would cause the /var/cpanel/userdata/*/domain.com ServerAlias to be overwritten after the changes have been properly distilled, but you are certainly free to add additional ServerAlias lines via an individual VirtualHost include file:

/usr/local/apache/conf/userdata/std/2/${USER}/${DOMAIN.COM}/*.conf

${USER} should be replaced by the cPanel account's username
${DOMAIN} should be replaced by the domain in the VirtualHost