SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Location
    A small village called Aunsby,Lincolnshire,U K
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Forward Slash at end of URL

    Hi

    Could one of you kind people tell me why I need to put a forward slash at the end of my URL , eg :-
    www. gordon brown.co.uk/

    I can't get onto the internet without it.
    Regards Monty

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    www.gordonbrown.co.uk alone is not a URL, it is just a hostname, the place the browser should contact to make the HTTP Request.

    You need a protocol (http://) and a path to request (/)

    But all major web browsers add the / to the end for you if you don't type it, so if yours isn't, something's broken

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Location
    A small village called Aunsby,Lincolnshire,U K
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Dan Grossman

    Many thanks for your prompt reply and for the information you have given.

    Regards Monty

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Adding the / yourself saves the browser having to add it for you.

    When you go deeper into your site than the home page then adding the / yourself makes a bigger difference. If you have example.com/name without the trailing / it will first look for a file called name and if it doesn't find that it will then add the / and look for a folder called name. If you add the / yourself in that situation you save one lookup.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •