View Full Version : SubDomains - Which folder to use as root?
daviddelmonte
12-28-2009, 04:13 PM
Hi all. Forgive if this has been covered.
I have a site that I'm splitting into pieces, each piece will be a subdomain.
I want to have sub.domain.com, not domain.com/sub.
Which folder do I publish my subdomain files?
public_html > sub gives me domain.com/sub.
Should I publish in /
Many thanks and happy new year in twentyTen.
David
farcaster
12-28-2009, 05:12 PM
If you created the subdomain in cPanel, then it will work both ways.
http://domain.com/sub
or
http://sub.domain.com
And files/folders for sub.domain.com get put in public_html/sub
felgall
12-28-2009, 05:18 PM
Except if you specified a different folder name when setting up the sub-domain.
If you created http://sub.example.com and specified that it should use the xyz folder then the content for that sub-domain goes in public_html/xyz
daviddelmonte
12-28-2009, 05:33 PM
That is exactly what I did.
subDomain/folder.
Actually public_html/folder.
Should I simply use public_html or / ?
Thanks a ton for the quick replies!!
David
farcaster
12-28-2009, 05:55 PM
From the top:
public_html/index.html (and other files and folders) will display as http://www.domain.com
Now say you want a subdomain called myblog
In cPanel create the subdomain, and when it asks, tell it the location and name. This would be public_html/myblog - in fact, it will get filled in for you. If you have already created the folder, no problem. Just continue.
Now, place your stuff for that subdomain as follows:
public_html/subdomain/index.html (or index.php, and all associated files and folders there).
You can access that two ways:
1. http://myblog.domain.com (probably the preferred way)
2. http://www.domain.com/myblog
daviddelmonte
12-28-2009, 06:00 PM
OK.. But what is the difference then between a sub-domain, and a sub-folder?
Sorry to be a PITA...
David
farcaster
12-28-2009, 06:06 PM
Nothing, until you set up the subfolder as a subdomain.
Otherwise, it contains data that is used by the web site - or at least should.
Go visit the cPanel and check out the subdomain icon.
daviddelmonte
12-28-2009, 06:08 PM
OK. Getting it... Slowly but slowly...
Thanks again Barry.
David
farcaster
12-28-2009, 06:20 PM
Actually when you declare a subdomain, the server engine is now able to let you use the http://myblog.domain.com method of calling it up in the browser.
It may take a few minutes for this to happen, so patience is the keyword there.
Otherwise, say your main site had a photo album called photos. That setup would look like:
public_html/photos
and accessed by http://www.domain.com/photos but NOT http://photos.domain.com since photos is not a subdomain.
michaelx
01-10-2010, 12:38 AM
Hi all. Sorry to bring up this topic again but I'm the exact same place the OP is/was.
I have a large site (IMO) and I'm wanting to create a photo and video gallery as a sub-domain, not an additional folder.
My followup question is this...
In my public_html 'folder' should I create a sub-folder that is specific to the naming of this particular site?
I also have a half-dozen other sites and I'd hate to use a generic name if it's likely to be used by some of the other sites in the future.
Sorry for the non-flowing-speak.... Kinda new to this.
So, if site 'XYZ' has a gallery I should name the new public_html folder as
'xyzgallery' so not to be confused later when another site needs a gallery as well, such as site 'ABC' and its 'abcgallery'??? Anywhere close?
Wow. I'm soooo sorry. That was grade school gibberish but I hope someone can read between the scribbles and point me in the right direction.
Thank you again for attempting to decode my ramblings and I thank you finally for any subsequent help.
Mike
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.