The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

addon domain question

Discussion in 'General Discussion' started by DWHS.net, Jan 19, 2006.

  1. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    You know how a addon reverts to the sub domain if you do not add a trailing when accessing a direct folder.

    Is there any way to get around that?

    like myaddon.com/folder - reverts to sub.domain
    myaddon.com/folder/ - works fine

    Thanks,
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Open httpd.conf file and just add this in VirtualHost before the closing tag:

    UseCanonicalName off

    An example:

    <VirtualHost 11.00.22.33>
    BytesLog domlogs/domain.com-bytes_log
    ServerName domain.com
    ServerAlias subdoman.com www.subdoman.com
    ServerAlias www.domain.com
    ServerAdmin wwwadmin@domain.com
    DocumentRoot /home/username/public_html/subdoman
    CustomLog domlogs/domain.com combined
    ScriptAlias /cgi-bin/ /home/username/public_html/subdoman/cgi-bin/
    User username
    Group username
    UseCanonicalName off
    </VirtualHost>
     
  3. DWHS.net

    DWHS.net Well-Known Member
    PartnerNOC

    Joined:
    Jul 28, 2002
    Messages:
    1,569
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    LA, Costa RIca
    cPanel Access Level:
    Root Administrator
    Amazing!

    Thank you very much, :D

    Chaze
     
  4. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    I have tried that and it makes no difference.

    Code:
    <VirtualHost 1.1.1.1>
    ServerAlias www.subdomain.domain.com
    ServerAdmin webmaster@subdomain.domain.com
    DocumentRoot /home/username/public_html/subdomain
    BytesLog domlogs/subdomain.domain.com-bytes_log
    User username
    Group username
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    ServerName subdomain.domain.com
    
    User username
    Group username
    CustomLog /usr/local/apache/domlogs/subdomain.domain.com combined
    ScriptAlias /cgi-bin/ /home/username/public_html/subdomain/cgi-bin/
    UseCanonicalName off
    </VirtualHost>

    In subdomains it shows:

    Code:
    subdomain.domain.com (subdomain)
    I have restarted apache and bind.



    I also tried putting it in the server-wide section for VirtualHosts.

    Thoughts?
     
  5. lloyd_tennison

    lloyd_tennison Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    698
    Likes Received:
    1
    Trophy Points:
    18
    Every thread says that (UseCanonicalName off) should work, but there are many people coming back and saying it does not, including me.

    Is there an answer that actually works?

    There was one suggestions to change

    but that did not work either, and sounds strange, as can have the same subdomain twice on the same server - just for different maindomains.
     
  6. borealphil

    borealphil Member

    Joined:
    Oct 21, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    same problem

    Hi, same problem than above. But I have other information:
    - I was at EV1 before, and I never noticed that problem before... Actually, according to my clients, before I moved their account to another datacenter

    - I do have that problem now with a new server in another datacenter

    - The only difference between the old server and the new server (what I could notice) is the usage of the "UseCanonicalName off" at the end of the virtualhost section.

    - the UseCanonicalName off does not work for me, like the other folks in this thread

    - And if it was working, with the last server, it was adding this directive automatically in the httpd.conf file, not manually everytime a custommer makes a complaint.

    My clients are very hangry, because all their sites (addon domains) now points to their main account. And just to add the badluck, their main account is a subdomain of my main domain since they did not have a main domain by the time they opened the account. So, if they don't rewrite all their pages to add a trailing slash, they end up with:
    subdomain.reseller.Mycompanywebsite.com

    Thanks for heliping me!
     
  7. borealphil

    borealphil Member

    Joined:
    Oct 21, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Something that worked

    Hi again,
    I used the
    UseCanonicalName Off

    in the main httpd.comf file. It seems that it worked but it seems that some browsers cache that... I changed browser and it worked for me.

    I just have to figure that refresh thing, cause I use a proxy when I'm in the office so my boss does not know what i'm doing!

    But this seems to be the solution, and no need to add code everytime a customer create an addon domain.

    Phil
     
Loading...

Share This Page