{"id":17,"date":"2018-03-29T20:00:46","date_gmt":"2018-03-29T20:00:46","guid":{"rendered":"http:\/\/digitalscholarship.brown.edu\/support\/uncategorized\/subdomains-vs-subdirectories\/"},"modified":"2020-08-03T17:45:39","modified_gmt":"2020-08-03T17:45:39","slug":"subdomains-vs-subdirectories","status":"publish","type":"post","link":"https:\/\/digitalscholarship.brown.edu\/support\/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 H<abbr title=\"HyperText Markup Language\">TML<\/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 blog on your new web space, where you are engaging in public scholarship. In addition, you are working on a large research project that requires you to build a web-based repository of digital images related to your discipline. You intend to use one application (say, <a class=\"urlextern\" title=\"http:\/\/wordpress.org\" href=\"http:\/\/wordpress.org\/\" rel=\"nofollow\">WordPress<\/a>) to manage the blog. For your research project, you&#8217;ve settled on another open-source application (Say, <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 <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<h4 id=\"root-domain\">Root Domain<\/h4>\n<div class=\"level5\">\n<p>Let&#8217;s say you&#8217;ve registered a new domain for digitalscholarship.brown.edu called <strong>myresearch.digitalscholarship.brown.edu<\/strong>. Anything that is stored at this core <abbr title=\"Uniform Resource Locator\">URL<\/abbr>\u00a0is considered to be at the\u00a0<strong>root<\/strong> of your domain. You may decide that you simply want to have a single site on your Web host (say a blog running WordPress), and you can then install WordPress at your domain&#8217;s root. To get to your site in this scenario, users would simply go to <strong>myresearch.digitalscholarship.brown.edu<\/strong>.<\/p>\n<\/div>\n<h4 id=\"subdomains\">Subdomains<\/h4>\n<div class=\"level5\">\n<p>If you want to have more than just a single website at the root of your domain, you will have to decide now to organize your space. One way to do so is by <a href=\"http:\/\/digitalscholarship.brown.edu\/support\/uncategorized\/setting-up-subdomains\/\">setting up\u00a0<strong>subdomains<\/strong><\/a>.<\/p>\n<\/div>\n<p>You may already be familiar with the concept of subdomains, even if you don&#8217;t know it. Consider Google&#8217;s website at https:\/\/google.com. As you browse features of that site, you\u2019ll notice that the domain changes. When you\u2019re looking at your Gmail account, for example, the domain changes to https:\/\/mail.google.com. Now the root of the url is mail.google.com, indicating that you\u2019re on the part of the site that is dedicated to Google&#8217;s mail services.<\/p>\n<p>In this instance, mail.google.com is a subdomain that provides a different utility than google.com. 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<div class=\"level5\">\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<h4 id=\"subdirectories\">Subdirectories<\/h4>\n<div class=\"level5\">\n<p>The alternative to subdomains for organizing your space is to use subdirectories. These function much like file folders on your computer. Instead of installing a WordPress site at <strong>myresearch.digitalscholarship.brown.edu<\/strong> you would place it in a subdirectory called \u201cresearch\u201d making the address <strong>digitalscholarship.brown.edu<\/strong><strong>\/research<\/strong>. Setting up a subdirectory is 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 have installed WordPress as your primary blog at <strong>myresearch.digitalscholarship.brown.edu<\/strong>. Later, you decide you want to install WordPress again for an image gallery site, and you want to place it at <strong>myreearch.digitalscholarship.brown.edu\/gallery<\/strong>. If for any reason you already have a page on your WordPress site called \u201cGallery,\u201d then the url <strong>myresearch.digitalscholarship.brown.edu.com\/gallery<\/strong> is already be taken.\u00a0 If you try to create a subdirectory of the same name, you&#8217;ll get a conflict and errors.<\/p>\n<\/div>\n<h4 id=\"tips-review\">Tips &amp; Review<\/h4>\n<div class=\"level5\">\n<ul>\n<li class=\"level1\">\n<div class=\"li\"><strong>Subdomains<\/strong> are 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. Subdomains also have much longer URLs, as you will prepend the subdomain name to [yourname].<strong>digitalscholarship.brown.edu<\/strong>.<\/div>\n<\/li>\n<li class=\"level1\">\n<div class=\"li\"><strong>Subdirectories<\/strong> don&#8217;t come with the neat URLs that subdomains have, but they are easier to set up, and may be easier to remember, as the application is a folder within the domain. They have the potential to for 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, youhave to consider how people are going to find them. If you have created a new primary blog at <strong>blog.myresearch.digitalscholarship.brown.edu<\/strong>, and someone goes to <strong>myresearch.digitalscholarship.brown.edu<\/strong>, they won&#8217;t see the new site. One solution is to set up <strong>redirects\u00a0<\/strong>so as to avoid this issue. You can also 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 just need one site, 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<h4 id=\"tutorials\">Tutorials<\/h4>\n<div class=\"level5\">\n<ul>\n<li class=\"level1\">\n<div class=\"li\"><a class=\"urlextern\" title=\"https:\/\/digitalscholarship.brown.edu\/support\/cpanel\/creating-subdomains\" href=\"http:\/\/digitalscholarship.brown.edu\/support\/uncategorized\/setting-up-subdomains\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">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-17","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":4,"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/posts\/17\/revisions\/657"}],"wp:attachment":[{"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalscholarship.brown.edu\/support\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}