This forum is in permanent archive mode. Our new active community can be found here.

Subdirectory vs. Subdomain

edited July 2007 in Technology
I just added some very basic forums to my site and the question came up of where to put them. I ended up going with a subdomain rather than a subdirectory and it got me to thinking.

What are the benefits and drawbacks between using subdirectories and subdomains when expanding your website?

Comments

  • Subdomains have a shorter URL, even if it's not necessarily a nicer one. However, subdomains require fiddling with DNS and your web server configuration. A subdirectory just requires creating a directory. Technically speaking, a directory is more "correct". In DNS terms, anime.frontrowcrew.com and games.frontrowcrew.com are in fact separate computers. Whereas www.frontrowcrew.com/anime or www.frontrowcrew.com/games are just different URIs of web content on the same machine.

    My general rule is that if I am making a completely separate web site, for example my blog, I will give it a completely different domain or subdomain. If it is just a different page on the same site, I will use subdirectories.
  • I can understand your rational there. I went with the subdomain for the forums just to make things easy on me. In the past, when I did not do my own hosting, subdomains often did not work as expected. One hosting company only allowed you to use them as pointers to a subdirectory: "forum.hmtk.com" would take you to "www.hmtk.com/forum". This did not work for me so I stuck with subdirectories.

    One day, I encountered a host that would allow me to use subdomains as they are meant to be used. They still used a subdirectory system but, when you typed in the subdomain the URL stayed that way: "forum.hmtk.com" would take you to "www.hmtk.com/forum" but it would look like "forum.hmtk.com" to the user.

    Now that I am hosting my own sites I have it even better in that the subdomains are above the "public_html" directory and I can give them their own logins/etc. This is how sites such as blogspot and wordpress do it and I like it!
  • Wow. It's really weird hearing the experience of people using managed hosting like that. It's scary to me how separated you are from how those things actually work.
  • Managed hosting is very scary. The big hosting companies use the same system as the Telcos do, they figure most sites will get little to no traffic so they overfill their servers.

    If you host with godaddy it is highly likely that 100+ other sites are also on that same server. This works when all of those sites are only getting 10 or 20 hits a day. It quickly breaks down when one or more of those sites become popular!

    I know of one game site (I can't remember how to spell the name) devoted to Cthulhu who were recently forced by their hosting company to move to a dedicated server. Even though they were under their allotted bandwidth they were using too much CPU time (so said the hosting company). It can really screw you up when you have a popular non-monetized website on a managed hosting server.

    For years Telcos designed their networks in such a way as to only allow 10% of the people to use their phone at the same time. The idea was that most people only make short telephone calls. The rise of dial-up Internet in the 90's killed the Telcos! They had to grow their switches fast because suddenly people were spending hours on their phone line! It's the same way with the big hosting companies, they shove a ton of sites on one server expecting most to never get any meaningful traffic.

    Now that I have my own server I get to look at all sorts of information. I can just leave an ssh client up and run top all day long if I want to (not that I do). I have not taken on any friend sites but I do have about 15 of my own on their right now and room for 15 more before I have to upgrade my control panel style software. I'm sure I could go in and manually edit files to allow for more domains but, is it really worth my time to do it? No. It is easier for me to spend $100 and get the unlimited domain version of the control panel software.
  • The fact that the server is shared is not what I'm talking about. I'm talking about the control panel software shielding you from the actual workings of your server. I would never trust a piece of software like that.
  • Ahh...

    I currently have both. I use the control panel software because it is easy but I always have the option to open up a terminal and work that way. Both are tools and as long as you know which one to use for the job you should be fine.
Sign In or Register to comment.