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.

Subdomain images require subdomain folder

Discussion in 'General Discussion' started by aoit, Jan 27, 2017.

Tags:
  1. aoit

    aoit Member

    Joined:
    Jun 4, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151
    I have two identical servers using DNS in a round robin. We found that one server is displaying images just fine, while the second server isn't displaying images. If I go to:

    https://sub.domain.com/images/1.png

    The image doesn't show up.

    If I change the URL to:

    https://sub.domain.com/sub/images/1.png

    Then the image appears.

    I have checked my htaccess and php configuration between the two servers, and can't find any differences. Can anyone shed some light on why this issue would occur?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can browse to the "Subdomains" option in cPanel to verify the document root matches the location where the images directory is uploaded. Also, what do you see in /usr/local/apache/logs/error_log when the image fails to load?

    Thank you.
     
  3. aoit

    aoit Member

    Joined:
    Jun 4, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151
    I found that using a PHP call to display all variables, the document root is showing /home/user/public_html. I checked the subdomain files in /var/cpanel/userdata/{user}/{sub.domain.com}

    The file contained the correct document root

    subdomain point to wrong document root

    This article shows the user appears to be having the same issue as me, but I didn't see a resolution. I have not tried deleting a subdomain and recreating since it appears from this thread that won't work.

    Do you have ideas on how to troubleshoot this?

    One of my servers is showing the document root correctly and the other is showing the document root as the /home/user/public_html and is missing the /subdomain at the end of the document root. Since the two servers are using identical WHM / Cpanel versions, the files and permissions are exactly the same, there must be a WHM / cPanel misconfiguration. I have several other wildcard domains with multiple subdomains, and none of them have issues on either server. The issue is narrowed down to a single domain with multiple subdomains all having the same issue.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page