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.

sub domain shows folder name rather than host name?

Discussion in 'Bind / DNS / Nameserver Issues' started by bleunetizen, Mar 5, 2015.

  1. bleunetizen

    bleunetizen Member

    Joined:
    Jan 27, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi guys,

    Having a small issue with subdomain...

    When I create a subdomain in cPanel, it creates new folder etc under public_html which is all good.

    but then when I type in the address, the url changes to the public_html/folder rather than showing the actual domain name.

    ie, say if my domain was "www.test.com" and I want a subdomain of "sub", if I type in "sub.test.com" it will send me to the right page (public_html/sub/) but the address bar of the browser also changes to "www.test.com/sub"

    How do I fix this so it will show "sub.test.com" instead of "www.test.com/sub" ?

    Thanks :)
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    It seems like this is happening due to custom redirect rules because it's not the standard behavior. Do you have any Mod_Rewrite rules configured within any of the .htaccess files on your account?

    Thank you.
     
  3. bleunetizen

    bleunetizen Member

    Joined:
    Jan 27, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks for the info.

    I tried removing .htaccess file and it indeed fixed the issue.

    What does the file do and do I need that file? WHen does that file get created?

    Thanks :)
     
  4. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    By default .htaccess files are usually empty when the account is created. It's used for redirects within cPanel and also to password protect directories.
    However, other software (WordPress, Joomla, Drupal and a slew of others) can also modify this file. It might contain something that is not compatible with the standard redirect cPanel uses.

    You'd have to examine the file and see if you can figure it out.
     
Loading...

Share This Page