Subdomains Vs Directories

Consider this scenario: you want to have a personal blog on your new Web space, where you share pictures and short written pieces with family, friends, and colleagues. In addition, you’re working on a large research project that requires you to build a Web-based repository of digital images related to your discipline. You want to use one application (for example, WordPress) to manage your personal blog. For your research project, you’ve settled on another open-source application (let’s say, Omeka). Both of these are applications that need to be installed on your Web host, but you can’t just put them both on your main domain name – if you did, both sites would quickly experience conflicts and errors. You need to cordon off separate spaces for your different Web “properties.”

There are two primary strategies for parceling up your Web space. You can create subdomains or directories. But before you can understand the difference, you need to first understand what we mean when we talk about your root domain.

Root domain

Let’s say you’ve registered a new subdomain for Coventry.Domains called pseudonym.coventry.domains. Anything that is stored at this core URL is considered to be at the root of your domain: nothing comes before the address or after the address. You can certainly decide that you simply want to have a single site on your Web host (say a blog running WordPress), and you can set that blog up at your domain’s root. To get to your site in this scenario, users would simply go to pseudonym.coventry.domains.

Subdomains

When you want to do more than just have a single website on your domain, you need to decide now to organize your space. One way to do so is by setting up subdomains.

You’re already familiar with the concept of subdomains, even if you don’t know it. Consider Coventry University’s public website at https://coventry.ac.uk. As you browse parts of that site, you’ll notice that the domain changes. When you’re looking at your department website, for example the site for the Library team’s Locate service at http://locate.coventry.ac.uk/, the URL is no longer just coventry.ac.uk. Now the root of the URL is locate.coventry.ac.uk, indicating that you’re on a different area that is dedicated to the Locate library online system.

Screenshot of website locate.coventry.ac.uk

If you browse to the student pages at students.coventry.ac.uk you will notice that the domain changes again, this time indicating that you’re in the Students Pages of the Coventry University website.

As you can see the domains serve two purposes: they help to organize the site from a technical perspective, but they also serve as indications to the users that they are in a new/different space.

As you work on your Coventry.Domains space, you’re welcome to create as many subdomains as you like, and in each subdomain you can create a distinct, individual website.

Directories

The alternative for organizing your space is to simply set up directories. These function much like file folders on your computer. Instead of creating a blog on a subdomain at blog.pseudonym.coventry.domains you would place it in a directory called “blog” making the address pseudonym.coventry.domains/blog. Setting up a directory is really easy. You can create folders on the fly when installing applications (like WordPress), and you can also manually create them in your file manager.

There is one particular issue you need to be aware of. Let’s say you’ve installed WordPress to be your primary blog at pseudonym.coventry.domains. Later, you decide you want to create another image gallery site on your site, and you want to place it at pseudonym.coventry.domains/gallery. But, if for some reason you’ve already created a page on your WordPress site called “Gallery” then the URL pseudonym.coventry.domains/gallery will already be taken. If you try to create a directory of the same name, you’ll get a conflict and errors.

Tips and review

  • Subdomains are generally a cleaner, more elegant solution to organizing your site. You’re less likely to get conflicts or errors. However, when using subdomains the process is slightly more complicated: You must create subdomains first before you can install anything in them.
  • Directories don’t create as pretty URLs as subdomains, but they’re easier to set up. They can, however, result in conflicts with existing Web pages.
  • As soon as you create subdomains or directories to organize your site, you need to consider how people are going to find them. If you’ve created a new primary blog at pseudonym.coventry.domains/blog, and someone goes to just pseudonym.coventry.domains, they won’t see that new site. You can create links from pages on one subdomain or directory of your site to another.
  • If you really just need one site, installing at the root of your domain is the easiest thing to do, at least as you’re getting started. You can always add more pieces to your territory later with either subdomains or directories.

This content is adapted from the Create Documentation by The University of Oklahoma’s Center for Teaching Excellence which is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

css.php