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.

point subdomain to the folder

Discussion in 'General Discussion' started by bickyz, Jun 18, 2012.

  1. bickyz

    bickyz Member

    Joined:
    Nov 4, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi i have a website as www.mysite.com and it has following pages
    www.mysite.com/news
    www.mysite.com/photo
    www.mysite.com/download

    how can i point
    news.mysite.com to www.mysite.com/news
    photo.mysite.com to www.mysite.com/photo
    download.mysite.com to www.mysite.com/download

    I have cpanel and shell access to my hosting.

    Any help would be much appreciated, thank you.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    When you create the Subdomain, that 'directory' is created. Depending on your needs I suppose:
    news.mysite.com and www.mysite.com/news should both work when you create the news. Subdomain.
     
  3. bickyz

    bickyz Member

    Joined:
    Nov 4, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    hi Infopro

    1. what happens if the folder named "news" already exist, will it overwrite?

    2. Also lets say www.mysite.com/photo is a url but not a folder; how do i setup a photo.mysite.com to point to the url www.mysite.com/photo



    thank you.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    To be honest, you might do best here to do some experimenting. Create a directory called bickyz normally, add an index.html and then create a Subdomain bickyz.yourdomain.com and see what happens. You might also want to experiment with the Redirects tools in your cPanel. Create a redirect for a non existent directory to another location and see how it goes.

    Testing yourself is always the best way to go. Just be sure to take backups when doing something that might be harmful to other things.

    GL! Post back your findings. :)
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    For subdomain creation, if the folder already exist, that isn't an issue. It can exist and you will still be able to create a working subdomain pointing to that folder. The same holds true for addon domains. The contents won't be overwritten either.

    In fact, this also holds true if you remove an addon domain or subdomain. We don't remove the folder contents.
     
  6. bickyz

    bickyz Member

    Joined:
    Nov 4, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    thank you very much; i did a test and it does exactly you have said.

    Can we point sub domain to a url like

    news.mysite.com to www.mysite.com/news.html
    or
    photo.mysite.com to www.mysite.com/photo
    here /photo is simply a seo friendly url not a folder.
     
  7. parelytic

    parelytic Member

    Joined:
    Jun 22, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes you would be able to redirect the subdomain. In fact cPanel has a great tool within the GUI to do this for you. Before adding the redirect, please make sure that the subdomain has been added first. Find the icon named "Redirects" within cPanel, and in this area you can redirect your news. and photo. subdomains however you wish.

    More information on the subject here: Redirects
     
  8. bickyz

    bickyz Member

    Joined:
    Nov 4, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    thank u parelytic,
    Is there a way to point to url rather than redirect. I think with redirect the url photo.mysite.com will be changed to http://mysite.com/photo wheres i want url to stay as photo.mysite.com
    Is this possible?
     
  9. arunsv84

    arunsv84 Well-Known Member

    Joined:
    Oct 20, 2008
    Messages:
    373
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Normally if you create a subdomain and set the document root to "photo" directory it will not redirect. Try to remove it and create again.
     
Loading...

Share This Page