Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Shakeerah822

2 Comments

Sorted by latest first Latest Oldest Best

 

@Debbie626

A slash at the end of a domain tells the server that the request is for the directory and that it should look for the default file (index.html, index.php) first.

It allows for faster loading time by telling the browser to look for the default file.


Traditionally, URLs that pointed to files did not include the trailing
slash, while URLs that pointed to directories do include the trailing
slash. This means that:
example.com/example/ is a directory, while example.com/example is a file



Read more here

10% popularity Vote Up Vote Down


 

@Megan663

All websites can be accessed with or without a slash on the domain name. All of the following work:

google.com/ and google.com www.khanacademy.org/ and khanacademy.org

In fact, when the browser requests home pages, it is required to submit the slash in the request, even if the slash is not present on the URL. This is a valid http request for example.com:

GET / HTTP/1.1
Host: example.com


This is an invalid request (because it is missing the slash):

GET HTTP/1.1
Host: example.com


The valid request corresponds to the either URL: example.com/ or example.com. There is no functional difference between those two URLs.

Webmasters are free to include or to leave out that trailing slash when linking. It makes no difference.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme