How to create SubDomains like "subdomain.domain.com"

Discussion in 'Site & Server Administration' started by kslokesh, Oct 2, 2008.

  1. #1
    I have a cPanel Linux Hosting and It allows me to create SubDomains. But they are just redirections.

    Eg:
    "subdomain.domain.com" Will be redirected to a folder
    (say home/public_html/subdomain/ ) which we can set in hosting cPanel.

    When we type "subdomain.domain.com" in address bar it will change to "domain.com/subdomain/"

    I need to make subdomains which retain their form "subdomain.domain.com" in the address bar.

    Eg: tripod and bravenet hosting.

    Typing "username.tripod.com" will remain the same in the addressbar.
    Similarly "username.bravehost.com" also.

    But cPanel hosting does not have this feature I think.

    Please help me how to make a subdomain retain its subdomain.domain.com format in the addressbar.

    Does it need any additions in the .htaccess file or any other method?

    Please tell me.
     
    kslokesh, Oct 2, 2008 IP
  2. Kionic.com

    Kionic.com Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi kslokesh,

    We run cPanel in our servers too and subdomains work perfectly fine. Typing in subdomain.domain.com will keep subdomain.domain.com in the address bar.

    Maybe check with your host to look at their configuration.
     
    Kionic.com, Oct 2, 2008 IP
  3. kslokesh

    kslokesh Well-Known Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Kionic.com can you access the pages directly through the subdomain?
    like subdomain.domain.com/abc.html etc..

    I have 4 domain (websites) hosted on different hosts. all using cPanel.

    check this in my site by entering:
    http://love.kslokesh.com

    It will change to:
    http://www.kslokesh.com/love/

    I really dont know what to do.

    cPanel Build: 11.23.6-RELEASE 27225

    please check it.
     
    kslokesh, Oct 2, 2008 IP
  4. Kionic.com

    Kionic.com Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi kslokesh,

    I went to test again for several domains in several servers and subdomains work just fine.

    Here is a test: http://test.kionic.com/index.html


    Let's try this: let's disable your .htaccess in kslokesh.com (in public_html) => by maybe renaming .htaccess to .htaccess.save (you can use the file manager to rename)

    => now clear your browser cache => or open a different browser i.e. if you used Firefox to open love.kslokesh.com earlier, now use IE to open http://love.kslokesh.com

    => observe how it behave after disabling your .htaccess?
    => if it works then check your mod_rewrite rules

    => if not, ask your host to have a look
     
    Kionic.com, Oct 2, 2008 IP
  5. kslokesh

    kslokesh Well-Known Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Hi Kionic.com,

    I came to know why it was happening. It was using redirection. Once I removed the redirection, All worked file.

    But there came another problem. I have Terms, Privacy Policy and Disclaimer Pages on my site to which the links are present in the footer of almost all the pages in my site. I have used Relative linking method "/terms.html" .

    If I click the links in the subdomain. it will result in 404 error as I have not placed any terms, provacy and disclaimer pages in the subdomain root folder.

    What I have: www.domain.com/terms.html and I am using "/terms.html"

    If I use subdomain.domain.com, then the "/terms.html" will result in 404 as I have used a relative linking.

    I think its better for me not to use the subdomains. or I must change the linking in all the pages or create a copy of those files to each subdomain root folder.

    Thanks a lot for your help. I learnt a lot of things from your suggestions. I really dint know that a new .htaccess file gets created if I rename a existing .htaccess file..
     
    kslokesh, Oct 4, 2008 IP