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 stop auto-creating directory

Discussion in 'General Discussion' started by dgware, Nov 11, 2013.

  1. dgware

    dgware Registered

    Joined:
    May 28, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I have a subdomain; xxx.domain.com which redirects to domain.com/xxx but it also keeps creating the xxx directory in public_html.

    How do I stop the creating of this directory. When I delete it, it comes back after a week or so.
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    don't create a sub domain just park it
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you elaborate a little more on the existing configuration in place? You mentioned a redirect to a sub-directory, but then also mentioned deleting that same sub-directory. cPanel should not automatically create directories on it's own without you creating the subdomain in the UI. Do you have any other third-party applications or scripts installed that could be creating the directory?

    Thank you.
     
  4. dgware

    dgware Registered

    Joined:
    May 28, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I created a subdomain in the UI: xxx.domain.com and the directory as public_html
    I then created a .htaccess file with the following content:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^xxx.domain.com$
    RewriteRule ^/?$ "http\:\/\/domain\.com\/xxx" [R=301,L]


    domain.com/xxx is not a directory, it's an application route. Cpanel automatically keeps creating the xxx directory which breaks the route.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    cPanel should not be automatically creating directories without user actions. Please 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.
     
  6. dgware

    dgware Registered

    Joined:
    May 28, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Support ticket: 4401173
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To update, the user was recommended to modify the .htaccess and list owa as an application route. EX:

    Code:
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} ^owa/
    RewriteRule ^ index.php [L]
    
    Thank you.
     
Loading...

Share This Page