addon domain / servername problem

webmeister

Member
Aug 5, 2002
8
0
151


Is there a way to get cpanel to use the right server_name for addon domains?

Problem: cpanel addon domains produce virtualserver containers in the httpd.conf file that use both the main account domain name and the new addon domain name as part of the httpd.conf servername directives... this produces urls like http://newdomain.com.accountdomain.com which confuse the websurfer and the search engines... for example...

<VirtualHost 127.0.0.1>
BytesLog domlogs/addon.com.accountdomain.com-bytes_log
ServerName addon.com.accountdomain.com
ServerAlias www.addon.com.accountdomain.com
ServerAlias addon.com *.addon.com
ServerAdmin [email protected]
DocumentRoot /home/accountname/public_html/addon.com
CustomLog domlogs/addon.com.accountdomain.com combined
ScriptAlias /cgi-bin/ /home/username/public_html/addon.com/cgi-bin/
User username
Group username
</VirtualHost>


Unless there is a great reason to do otherwise, at least from my viewpoint as a programmer, cpanel should be writing something like:

<VirtualHost 127.0.0.1>
BytesLog domlogs/addon.com-bytes_log
ServerName addon.com
ServerAlias www.addon.com
ServerAlias addon.com *.addon.com
ServerAdmin [email protected]
DocumentRoot /home/username/public_html/addon.com
CustomLog domlogs/addon.com combined
ScriptAlias /cgi-bin/ /home/username/public_html/addon.com/cgi-bin/
User username
Group username
</VirtualHost>

The main issue is that cpanel should be writing

ServerName addon.com
ServerAlias www.addon.com
ServerAlias addon.com *.addon.com

If there is a way to force this by configuration please advise. Also consider this a "bug fix" request ;-) ... some scripts need to know what server they are running on and these double-size url's are a pain from a programmers perspective.

Thanks!
DC
 

vwiley1

Well-Known Member
Oct 4, 2003
87
0
156
...

I would also like to see this fixed. This can cause problems. Here is an example of a problem it is causing.

One of my clients has 3 domains. He wants to keep the domain I set his cpanel account up with totally out of the picture.

When people go to: http://addondomain.com/

They are automatically redirected to http://addondomain.clientsdomain.com/

He does not want people going to his add on domain to know anything about his main domain.

How do I fix this?
Prevent it from happening again?
 

webmeister

Member
Aug 5, 2002
8
0
151
yes... this is a simple easy fix for cpanel to just rewrite the couple of lines that write those entries in the httpd.conf ...