Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

URL Types

  • 26-01-2014 1:03am
    #1
    Registered Users, Registered Users 2 Posts: 2,815 ✭✭✭


    Could someone please explain the difference between

    http://shop.mysite.com

    and

    http://www.mysite.com/shop


    What is the correct terminology to identify each one and why would a developer choose one over the other?

    Cheers


Comments

  • Closed Accounts Posts: 9,700 ✭✭✭tricky D


    Which one to choose?

    For SEO, the sub directory is very slightly ahead, but that tiny advantage might be removed by site management and development, and other considerations eg. branding or franchising issues. There's not really a right answer. I would usually go for sub directory, but wouldn't worry if sub domain was easier to use in some instances.



  • Registered Users, Registered Users 2 Posts: 6,289 ✭✭✭Talisman


    why would a developer choose one over the other?
    A sub-domain would have to be used if the content/application resided on it's own server. Every machine connected to a network has a unique name, the internet is no different. Take Amazon AWS as an example, the service is offered from different physical locations around the world but it's the same company offering the service:
    EU region S3 url pattern: s3-website-eu-west-1.amazonaws.com
    East coast US url pattern : s3-website-us-east-1.amazonaws.com

    Another scenario where you might want to use a subdomain is for the purpose of hosting static assets such as image/css/js files for a website. A web browser will open a limited number of concurrent connections to a domain so if you host all of the content in subfolders your pages will load more slowly than if you split the content across subdomains.
    e.g. Requests to www.yourdomain.com/css, www.yourdomain.com/js, www.yourdomain.com/images will be queued in a single queue. If you were to break the assets out into their own subdomains the page will load quicker because requests to css.yourdomain.com, js.yourdomain.com and images.yourdomain.com will be placed in 3 queues.

    In terms of SEO, I don't think it makes much of a difference anymore whether you use keyword.domain.com or domain.com/keyword since Google switched their search algorithm to no longer be keyword based.

    I think the big difference between the two is security. Hosting an application in a subdirectory would seem less secure, as any successful attack on a subdirectory could expose the primary domain to vulnerability. The trade off in this scenario is that if you have a second domain to maintain then you are doubling up on costs and maintenance/security.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Talisman wrote: »
    A sub-domain would have to be used if the content/application resided on it's own server.
    C'omon, you know that's not actually true - how many servers do you think Boards.ie is sitting on, and how many sub-domains do you see in the address-bar?

    Other than some of the differences raised here already (I actually didn't know about the SEO implications), the use of sub-domains is often more organizational or even aesthetic. A sub-domain may actually reside on the same server as the default sub-domain (by accepted convention, this is 'www'), but sometimes it may make sense to seperate different sub-sites, such as shop.mydomain.com, clients.mydomain.com, mobile.mydomain.com and so on.

    Another thing I've seen sub-domains used for is for session management. Using this technique the sub-domain portion of the URL is the session ID, thus eliminating the need for cookies and lengthy URL's, that were a particular problem with early WAP browsers, for example.


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    Logically, I generally think of subdomains as being different sites, for e.g. www.google.com, mail.google.com and maps.google.com, whereas subfolders would be different areas/sections within the same site.

    Technically there can be a few different reasons for using subdomains. Other than the ones mentioned already, browsers by default will only send a limited number of concurrent requests to the same server (or server cluster), so spreading resources across different sub domains will allow for more concurrent requests and speed up page loading times.

    Also, in the .Net world at least, different subdomains are generally (though not nessecarily) different IIS sites with different web applications, which means they can run under different processes with different authentication schemes etc. That can be done with subfolders too, but using subdomains is a nice logical way to keep them organised differently. I'd guess the LAMP side of things is roughly the same.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,289 ✭✭✭Talisman


    C'omon, you know that's not actually true - how many servers do you think Boards.ie is sitting on, and how many sub-domains do you see in the address-bar?
    Boards.ie uses a load balancer to distribute traffic to the servers. I could have added that scenario to my post but didn't think it was relevant to the original question.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Talisman wrote: »
    Boards.ie uses a load balancer to distribute traffic to the servers. I could have added that scenario to my post but didn't think it was relevant to the original question.
    Never said it would be relevant, only that what you wrote was not correct - sub-domain would not have to be used.


Advertisement