Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Apache UseCanonicalName set to On

Discussion in 'EasyApache' started by Haym, Jan 23, 2018.

  1. Haym

    Haym Active Member

    Joined:
    May 12, 2017
    Messages:
    39
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi,

    I ran into an issue today where a customer's addon domain was being redirected to the relevant subdomain when performing a missing trailing slash redirection on a directory. For some reason "UseCanonicalName" was set to "On" for this particular vhost, while most on the server are set to "Off" (as I would expect). I created an include to fix this for the vhost in question.

    Is there a reason cPanel configures some vhosts with UseCanonicalName set to On?

    Code:
    [root@server ~]# grep "UseCanonicalName Off" /etc/apache2/conf/httpd.conf | wc -l
    774
    
    [root@server ~]# grep "UseCanonicalName On" /etc/apache2/conf/httpd.conf | wc -l
    28
    
    Thanks
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,721
    Likes Received:
    1,705
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @Haym,

    We do have an internal case open (CPANEL-17936) to address an issue where UseCanonicalName is automatically set to "On" when subdomains are created through the SubDomain::addsubdomain cPanel API 2 function. I'll monitor this case and update this thread with more information as it becomes available. In the meantime, the following command can correct this in some cases:

    Code:
    /usr/local/cpanel/bin/userdata_update
    Thank you.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,721
    Likes Received:
    1,705
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, a resolution for CPANEL-17936 is planned for inclusion with cPanel version 72. It adds a UAPI call for adding a subdomain, with "UseCanonicalName" set to "Off" by default. Note that the behavior for the corresponding cPanel API 2 function will not change, as we avoid making changes to longstanding API behavior to ensure existing scripts using those API functions operate as expected.

    Thank you.
     
Loading...

Share This Page