Should you use subdomains or subdirectories?

Wednesday, April 8th, 2009 1:05 am

Categories: Hosting, SEO.

Tags: , , ,

I receieved an interesting question from one of my photographer friends Gustavo Fernandez today. “Why do some folk have their address as blog.domain.com vs domain.com/blog? Is there a benefit?”

I started to write back, but in doing a couple quick searches in the name of research, I found enough interesting information that I decided to write a post explaining it all.

Subdomains vs Subdirectories

Control Panel
Creative Commons License photo credit: Tim Dorr

First, let’s define what we are talking about: “blog.domain.com” is a subdomain while “domain.com/blog” is a subdirectory or a folder within a domain.

A subdirectory is used as a folder within one domain to organize smaller pieces of content, like a category of several pages. For most people they will only ever need subdirectories.

A subdomain creates more separation than just a folder, basically creating a stand alone site that could easily be it’s own domain. However, you may want to piggyback on the main domain name. For example, google.com is the main site. Gmail actually lives at mail.google.com. Google Maps lives at maps.google.com, and Google Documents at docs.google.com. These are each stand alone sites and could be their own domains but they make more sense under the google umbrella.

On my own domain, I setup several subdomains to handle different aspects of my business. One contains all the temporary websites while I build them, including several installatons of wordpress and a few standard html sites that I use to test things on. This allows me to work on projects without making the under construction site visble on the client’s domain. Another subdomain was specifically setup to handle my project management. I use a system called ProjectPier, an open source project management app that allows me to share and store files, messages and task lists with an entire team and with the client. Each one of these subdomains is basically a site in and of itself. I want to keep everything within those subdomains separate from my main site.

So there are some different reasons at the hosing/server level for keeping your site organized. But as far as the url, it doesn’t make too much difference to me whether something like a blog lives at blog.domain.com or domain.com/blog.

How do subdomains effect SEO?

According to this article, subdomains used to help with SEO because there was a chance domain.com AND blog.domain.com would show up in results while there was (and is) a limit on two pages per domain in a search engine results page (SERP). You might see two pages from one site rank really high for books, but amazon is not going to take up the whole front page. However, setting up subdomains apparently used to trick the search into thinking it was looking at a new site so technically several subdomains could all end up on the front page, which would look really good. Of course, google is all about trying to provide relevant results, so a page of subdomains should no longer happen. For example if you are a national construction company that wants to get listed for each city, you might setup subdomains like losangeles.mycompany.com and boston.mycompany.com, then just copy your site over and over, swapping out the keywords and every mention of the city to match the the site. The problem is that there is no real interesting or different content on all these sites and in fact it is very obviousy duplicate content so the SEO effect is actually negative. Or you might try cellphones.myphonestore.com, mobilephones.myphonestore.com, and on and on hoping that all of these ‘sites’ might rank high, but the best result anywhere within “myphonestore.com” is all that would show up.

One strategy that could make sense would be to create a subdomain for a section of your business or site that could really be a standalone site. If you are a department store, you may have “mystore.com” and use “electronics.mystore.com” to create a site with great SEO specific to electronics, since the searches will see it essentially a stand alone site about electronics. Then use “food.mystore.com” to target searches specific to food. If you had those things combined (along with ten others – shoes, jewelry, etc. ) the content is not as specific and may be confusing as to what the site is about. Meanwhile, they all still help pump up the image of the main domain “mysite.com”. You have created several specific relevant sites all benefitting from the main brand of “mystore.com”.

Which one should I use?

For most situations and for the average website, the easiest solution is a new subdirectory. If you are setting up a new blog, you can create a folder called “blog” install wordpress and you have your blog at “mydomain.com/blog”. There is no reason to use a whole subdomain for that. I like the simple idea that if you could almost justify starting an entirely new (but related) site, then use a subdomain. If you are simply adding a new category of pages with similar content, then just use a subdirectory. Save the subdomain for something that is big enough and clearly separate enough that it needs to be its own site.

What is your experience with subdomains?

If anyone has a set-up using subdomains, why did you go that route? Do you see any benefit or negative effects of setting it up that way?

Share/Bookmark

20 Comments to Should you use subdomains or subdirectories?

  • Gustavo says:

    Thanks Marty for the great article and taking the time and answering my question in depth, crystal clear for me now.

    • Marty says:

      No problem, Gustavo. Keep sending me great questions and inspiring topics for articles. I might have to write one soon about your use of googledocs!

      • Shivesh says:

        Hi Marty
        I am going to create websites http://www.country.com for all cities so i am confuse how to create them………..
        should i use subdomains or sub directories and i also want city wise domain names like http://www.london.com which is useful for london users to remember..

        Should i use

        1. http://www.london.com ( a single page which have all links of http://www.country.com/london/computers or
        2. whole http://www.london.com/computers)
        3. london.country.com
        4. http://www.country.com/london

        if option 1 will not effect my main website ranking and will improve my ranking then i want to use that but i am too confused about google search.

        Another Question is

        if i create many different sites and use relevent data on that and i give give them my main website link for mare informations……………………

        Please suggest me in too confuse…. both are diffrent questions

        • Marty says:

          I am not exactly sure about a couple of the questions but…

          As I mentioned in the article, I would use subdomains for anything that could stand alone as a site itself. If it is just a page (or even up to several pages) worth of content, use a subdirectory.

          Subdomains are viewed as different sites. Which can be good because you might target that city more. But it would not really build up the power of the main site unless you do a good job of linking back to it and linking amongst the different sites.

          Think of them as standalone sites. The benefit is that I can see country.com in the name so I might be drawn to that and it helps brand that name because I will see london.country.com, newyork.country.com, etc the consistent brand becomes country.com

          Beyond that, it really depends on the content you are offering on each. Without knowing and analyzing that, I wouldn’t want to suggest one of these options over the other for anyone.

  • Wendy says:

    I just set up a sub-domain this weekend to add pet photography on to my dog daycare business. I chose the sub-domain because there was so much information, the photography aspect basically required a website all its own and it seemed easiest to just create a new subdomain rather than a completely different domain.

    • Marty says:

      Hi Wendy,

      I think that was a great choice and a great example of how to use a subdomain correctly. This way both businesses can be separate but still attached and feed off of each other. Even the curiosity factor makes me go to the main domain sometimes. So if I see your http://photography.paws-on-the-run.ca/ then I will probably take a look at http://paws-on-the-run.ca/ but if you started some unrelated domain I might never know your other site existed.

  • J Sandifer says:

    A subdomain is basically just another site…if you are creating new content and not trying to work the system then it can work for you. Google knows when someone is trying to game their bots…they are pretty smart that way. Having your blog as a subdirectory is what I have seen most and looks like what you are suggesting here as well. There is a third way of pulling this off…using a .net for the blog and keeping it separate from your .com. This way if you move either you don’t have to worry about the other and you can establish it as an authority separately to link back to your .com.

    Algorithms are always changing so it is good to continually be looking at this and how it is affecting search. As we move forward, search is becoming increasingly important!

    See you in a couple of weeks!

    • Marty says:

      Thanks for the comment J!

      The team at google and the algorithm they use is smarter than we are, it is not completely known, and as you pointed out, always changing to keep up with the changes of the web. So I always try to point out that any system that thinks it is fooling or getting around the search engines is not going to work and will probably get you in trouble.

      I actually prefer to have “mydomain/blog” rather than a subdomain. I view a blog slightly differently than some though. To me a blog is just another part of my site. I like to build entire sites (including this one) in wordpress with the blog page just being another page in that site.

      The .net thing is a possibility but I would suggest not using that for a few reasons… 1) A completely separate domain needs separate hosting (or an addon account within one hosting account, which can start to make things messy with a bunch of folders.)
      2) It adds another domain registration to pay for and to keep track of.
      3) If I go to mydomain.net, I would probably assume that they only have that one site and I would not go look at the .com but if they had blog.mydomain.com I would know it is an offshoot of another domain and check it out.

      The ease of moving one without the other is interesting though. Blogs are all pretty easy to import/export between each other or to different domains. But do you have a specific idea of when that might be needed?

      Looking forward to St. John! See you soon.

  • Gregg says:

    Just googled this subject for a friend that wanted separate landing pages for specific keywords, this perhaps seems like another option, perhaps a better option and would negate having to buy additional domain names. Good post.

  • Char says:

    I have a client who is having me set up 100′s of subdirectories under his top domain and each of these 100 subdirs are just a copy of the same site over and over again. I told him this was not a good thing. Am I wrong or am I right? The only thing he changes is he adds the subdir url to the meta description and title.
    I’d appreciate your input on this! I’ve searched everywhere and can’t find any info concerning this method of SEO.
    Thanks!

  • liza says:

    Hi! One of my client have installed a blog in subdomain but after 2 years, he decided to move it in a subdirectory. We have a pretty nice PR and traffic as well. Would moving from a subdomain wordpress installation to a subdirectory affect our precious SEO efforts? I know that there will be since we will change URL but then I don’t know how big the impact would be. Can you tell? Thanks!

    • Marty says:

      Hi Liza,

      Don’t make that switch unless you know how to set-up the 301 redirects.

      While it would seem to be not a big deal since it is on the same domain, you might as well be deleting your whole site.

      Any links to your site will be looking for ‘blog.domain.com/page-title’ but that no longer exists. The same pages might be at ‘domain.com/blog/page-title’ but how would they know? It could be at ‘some-random-new-domain.com’ or it could be gone completely.

      The search engines might eventually crawl your site again and find everything, but it would be like creating a new site. Meanwhile, all those links that gave you such great PR are pointing to other URLs – your old site.

      As long as you use 301 redirects, the links will all carry over and the search engines will follow as well, removing you old URLS and replacing them with the new ones and, in theory at least, you won’t lose anything.

      If you don’t set that up, you risk not only losing all that PR but losing points for a lot of 404 errors for broken links. You will also need to make sure you redirect any RSS feeds you might have had at the subdomain so you don’t lose any subscribers.

      If you don’t don’t know how to do any of that, drop me a line.

      -Marty

  • Matt B says:

    Marty,

    Just thought of a new use for subdomain.

    Let’s say your company’s hosting only provides for java or .NET and did not support PHP. However, you wanted a WordPress Blog at your domain name. A change to the cname record could point the subdomain blog.company.com to a separate server with PHP.

    Hmmm… I wonder if that would affect the SEO though.

    What do you think?

    -Matt

    • Marty says:

      That would be a great way to add a WordPress blog to a site using a host that isn’t currently WordPress compatible.

      Not sure what your SEO concerns are though. Are you worried about the php / .net or using the subdomain when normally you could have used a subdirectory?

      I don’t know that either would influence it all that much. For the most part as long as you have great content and have it on a domain you own (whether it is blog.domain.com or domain.com/blog) and not using a blog.wordpress.com or blog.blogspot.com address you should be set.

  • Jim says:

    Marty,

    There’s an existing line of business that serves cities across the US. I’ll use carpet cleaning as an example. I have been asked to create either a sub domain, sub folders, or separate web pages for each city in the US that would use the carpet cleaning service. Currently competitors are doing the same and have a static html page for every city (30,000+ pages on their site). Customers normally search for city, state and “carpet cleaning” so having a page appear in search rankings that is localized to that city gains a lot of business.

    Setting up subdomains for every city would be 30000 sub domains but it is much cleaner since the webserver can serve up dyanmic content based on subdomain instead of cluttering up the webserver with sub folders or lots of pages.

    My concern is whether search engines would see this as duplicate content. The content is small and the only duplication is the carpet cleaning terms and description but the localized content for the city is much greater such that zip codes, cities, and local businesses are listed that are provided the service.

    I question if google would see this as duplicate content or not. If they saw 30,000+ subdomains, it would certainly lift an eyebrow but seems ligitamate that a service is advertised in a search engine for all the cities it services. I wonder if anyone has taken this approach to create 30,000+ subdomains and whether there would be any performance issues created that were unexpected. Being banned from search engines totally defeats the purpose.

    • Marty says:

      From the sounds of it, this is the epitome of the duplicate content idea. You basically said it yourself – the only reason for the duplicate pages is to rank in different cities and the content is essentially the same. Or is it a different list of companies on each page? That might be different if it is essentially a directory?

      Assuming for a second this is duplicate content and a somewhat spammy idea… I have seen plenty of sites that get away with this, at least for a while. But I would assume that they are often short-lived. I know some of the companies that practice this type of thing jump around from domain to domain so if one gets in trouble they are ready to get the next one going and they don’t care. So if you are setting up fake domains like 123plumbing.com and a-plus-los-angeles-plumbers.com then who cares if you get banned, you can make another. Just plan for it. This won’t be a site to last for years.

      But if this your branded domain, like myname.com then you want to hold on to that and I would not do anything like what you are describing.

      Please don’t get me wrong. I am not advocating this idea, nor saying it is illegal or even a bad business idea. I compare this idea or any spam idea to buying bulk email lists and sending junk email, sending traditional junk mail, or hiring a telemarketing firm to harass people at home by the thousands. It might be worth the money in the end, it might drive business, especially for a bulk driven business that operates across the country.

      But it is not legit (to me) and I won’t do sites like that. I personally consider it spam, regardless of whether it is legal, allowed, looked down upon, or whatever.

      If I had someone who wanted to get found for locations across the country I would recommend setting Local Business Google listings and Yahoo listings for those locations. Create Yelp listings. And get customers to review you there. More work. Maybe. But if you are getting booted from search listings and redoing this all the time, that’s a lot of work too.

      That’s just my take.

  • Wendy C says:

    Hi Marty
    My client is part of a large organtisation and their content is lost on the main corporate site – it is buried deep and usability is not good as is difficult to find.
    I have been advising they should set up a new sub domain as this would help them group their content together and get more exposure with their clients and the search engines (there are no issues with duplicate content).
    They are now talking about a completely new domain instead. My concern from an SEO perspective is related to domain ageing – the SEs like older well established domains – and their corporate domain has been around eons. Am I right is saying a sub domain is the better approach as it will help the SEs understand that it is part of the main domain family and not treat it with any ageing penalty? Or will the sub domain be treated same as an entirely new domain?
    Many thanks!

    • Marty says:

      Hi Wendy,

      My thought on subdomains is usually from a usability standpoint. To me it easiest for people to remember ‘mysite.com/blog’… then ‘blog.mysite.com’. It it kind of losing people once you do ‘mysite.com’ and then ‘mynewsite.com’.

      As far as SEO, you can always (and should) do a 301 redirect anyway, so that hopefully none of that built up search engine power is lost. In the case this is done right, it should matter where you go. This is why people buy old domains and redirect them to new things.

      Search engines do see each subdomain (even www.) as a separate site and that is why it is recommended to choose either ‘http://www.mysite.com’ or ‘http://mysite.com’ as your preference and direct traffic with a 301 redirect to the correct one. Otherwise you are splitting your incoming links between the people who chose to link to www or non-www.

      Subdomains, while attached to the main domain, are also separate and at that point I honestly don’t know what is better. It would be specific to the content and a lot of things.

      Using new domains can be a good thing for SEO. Linking between them (as long as it is not spammy) is good. Ideally you would set them up on different IP addresses and that would be even better. Links between sites on the same IP address are a little too obvious.

      Again, though, the 301 redirect is key. As long as you do that correctly, all links and page rank should follow though. That is if the site is staying the same. Changes in content, design, even doing something that in the long-term might be a better thing for your site, could cause a short-term drop simply because whatever you were ranking for changed.

      Any of these situations could be better than a large site with hidden content that is hard to navigate.

      -Marty