{"id":34,"date":"2018-09-06T13:37:08","date_gmt":"2018-09-06T13:37:08","guid":{"rendered":"http:\/\/domains.skidmore.edu\/docs\/uncategorized\/subdomains-vs-subdirectories\/"},"modified":"2018-09-06T13:37:08","modified_gmt":"2018-09-06T13:37:08","slug":"subdomains-vs-subdirectories","status":"publish","type":"post","link":"https:\/\/domains.skidmore.edu\/docs\/uncategorized\/subdomains-vs-subdirectories\/","title":{"rendered":"Subdomains vs. Subdirectories"},"content":{"rendered":"<div class=\"level1\">\n<p>When you&#8217;re first getting started with a new space on a new Web host, you might think of yourself as owning a small \u201cterritory\u201d of the Web. Everything you place in your public folder on the server becomes available for anyone on the Web to see (assuming they know the address of your site and the files you&#8217;ve placed there).<\/p>\n<p>If you&#8217;re just putting up a handful of static,\u00a0<abbr title=\"HyperText Markup Language\">HTML<\/abbr>\u00a0pages which you want to make available to colleagues, friends, or family by sending them links, then working with this large, unorganized space may work. But as soon as you get to the point where you want to organize your site, you&#8217;re going to need a new strategy.<\/p>\n<p>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&#8217;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 (say,\u00a0<a class=\"urlextern\" title=\"http:\/\/wordpress.org\" href=\"http:\/\/wordpress.org\/\" rel=\"nofollow\">WordPress<\/a>) to manage your personal blog. For your research project, you&#8217;ve settled on another open-source application (Say,\u00a0<a class=\"urlextern\" title=\"http:\/\/omeka.org\" href=\"http:\/\/omeka.org\/\" rel=\"nofollow\">Omeka<\/a>). Both of these are applications that need to be installed on your Web host, but you can&#8217;t just put them both at your main domain name \u2013 if you did, both sites would quickly experience conflicts and errors. You need to cordon off separate spaces for your different Web \u201cproperties.\u201d<\/p>\n<p>There are two primary strategies for parceling up your Web space. You can create\u00a0<strong>subdomains<\/strong>\u00a0or\u00a0<strong>subdirectories<\/strong>. But before you can understand the difference, you need to first understand what we mean when we talk about your\u00a0<strong>root<\/strong>\u00a0domain.<\/p>\n<\/div>\n<h5 id=\"root-domain\">Root Domain<\/h5>\n<div class=\"level5\">\n<p>Let&#8217;s say you&#8217;ve registered a new domain for domains.skidmore.edu\u00a0called yourdomain.com. Anything that is stored at this core\u00a0<abbr title=\"Uniform Resource Locator\">URL<\/abbr>\u00a0is considered to be at the\u00a0<strong>root<\/strong>\u00a0of 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&#8217;s root. To get to your site in this scenario, users would simply go to yourdomain.com.<\/p>\n<\/div>\n<h5 id=\"subdomains\">Subdomains<\/h5>\n<div class=\"level5\">\n<p>When you want to do more than just have a single site at the root of your site, you need to decide now to organize your space. One way to do so is by <a href=\"http:\/\/domains.skidmore.edu\/docs\/#setting-up-subdomains\">setting up\u00a0<strong>subdomains<\/strong><\/a>.<\/p>\n<p>You&#8217;re already familiar with the concept of subdomains, even if you don&#8217;t know it. Consider OU&#8217;s public Web site at\u00a0<a class=\"urlextern\" title=\"http:\/\/ou.edu\" href=\"http:\/\/ou.edu\/\" rel=\"nofollow\">http:\/\/ou.edu<\/a>. As you browse parts of that site, you&#8217;ll notice that the domain changes. When you&#8217;re looking at your department Web site, say the site for the Chemistry &#038; Biochemistry Department at\u00a0<a class=\"urlextern\" title=\"http:\/\/chem.ou.edu\" href=\"http:\/\/chem.ou.edu\/\" rel=\"nofollow\">http:\/\/chem.ou.edu<\/a>, the\u00a0<abbr title=\"Uniform Resource Locator\">URL<\/abbr>\u00a0is no longer just ou.edu. Now the root of the url is\u00a0<strong>chem.ou.edu<\/strong>, indicating that you&#8217;re on the part of the site that is dedicated to the Chemistry &#038; Biochemistry Department.<\/p>\n<p>If you browse to the technology store pages at\u00a0<a class=\"urlextern\" title=\"http:\/\/itstore.ou.edu\" href=\"http:\/\/itstore.ou.edu\/\" rel=\"nofollow\">http:\/\/itstore.ou.edu<\/a>, you&#8217;ll notice that the domain changes again, this time indicating that you&#8217;re in the technology store of the OU site.<\/p>\n<p>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.<\/p>\n<p>As you work on your site, you&#8217;re welcome to create as many subdomains as you like, and in each subdomain you can actually create a distinct, individual Web site.<\/p>\n<\/div>\n<h5 id=\"subdirectories\">Subdirectories<\/h5>\n<div class=\"level5\">\n<p>The alternative for organizing your space is to simply set up subdirectories. These function much like file folders on your computer. Instead of creating a blog at\u00a0<strong>blog.yourdomain.com<\/strong>\u00a0you would place it in a subdirectory called \u201cblog\u201d making the address\u00a0<strong>yourdomain.com\/blog<\/strong>. Setting up subdirectory 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 browser.<\/p>\n<p>There is one particular issue you need to be aware of. Let&#8217;s say you&#8217;ve installed WordPress to be your primary blog at\u00a0<strong>yourdomain.com<\/strong>. Later, you decide you want to create another image gallery site on your site, and you want to place it at\u00a0<strong>yourdomain.com\/gallery<\/strong>. But, if for some reason you&#8217;ve already created a page on your WordPress site called \u201cGallery\u201d then the url\u00a0<strong>yourdomain.com\/gallery<\/strong>\u00a0will already be taken. If you try to create a subdirectory of the same name, you&#8217;ll get a conflict and errors.<\/p>\n<\/div>\n<h5 id=\"tips-review\">Tips &#038; Review<\/h5>\n<div class=\"level5\">\n<ul>\n<li class=\"level1\">\n<div class=\"li\"><strong>Subdomains<\/strong>\u00a0are generally a cleaner, more elegant solution to organizing your site. You&#8217;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.<\/div>\n<\/li>\n<li class=\"level1\">\n<div class=\"li\"><strong>Subdirectories<\/strong>\u00a0don&#8217;t create as pretty URLs as subdomains, but they&#8217;re easier to set up. They can, however, result in conflicts with existing Web pages.<\/div>\n<\/li>\n<li class=\"level1\">\n<div class=\"li\">As soon as you create subdomains or subdirectories to organize your site, you need to consider how people are going to find them. If you&#8217;ve created a new primary blog at\u00a0<strong>blog.yourdomain.com<\/strong>, and someone goes to just\u00a0<strong>yourdomain.com<\/strong>, they won&#8217;t see that new site. It is possible to set up\u00a0<strong>redirects\u00a0<\/strong>to avoid this issue. You can also always create links from pages on one subdomain of your site to another.<\/div>\n<\/li>\n<li class=\"level1\">\n<div class=\"li\">If you really just need one site, sometimes installing at the root of your domain is the easiest thing to do, at least as you&#8217;re getting started. You can always add more pieces to your territory later with either subdomains or subdirectories.<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<h5 id=\"tutorials\">Tutorials<\/h5>\n<div class=\"level5\">\n<ul>\n<li class=\"level1\">\n<div class=\"li\"><a class=\"urlextern\" title=\"https:\/\/domains.skidmore.edu\/support\/cpanel\/creating-subdomains\" href=\"http:\/\/domains.skidmore.edu\/docs\/#setting-up-subdomains\" rel=\"nofollow\">Setting Up Subdomains<\/a><\/div>\n<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>When you&#8217;re first getting started with a new space on a new Web host, you might think of yourself as owning a small \u201cterritory\u201d of the Web. Everything you place in your public folder on the server becomes available for anyone on the Web to see (assuming they know the address of your site and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/domains.skidmore.edu\/docs\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}