Domainmonster.com Domain Editorials

Home > Editorials

17-Jul-2007

Closing Slashes on Web Page URLs

As a rule of thumb, you should always include the final / on links to URLs which end in a directory. For example, "http://www.mywebsite.com/mystuff" is better written "http://www.mywebsite.com/mystuff/".

This is because without the slash, the browser will initially try to retrieve a file rather than a directory, and only when the server realises that "mystuff" is a directory will it direct the browser to add a slash to the end of the URL and try again. Whilst this doesn’t seem too much of a problem, it will slightly increase your bandwidth usage every time it happens, so if you're running a high-traffic site, it's worth adding in those closing slashes.

It's also worth nothing that if your URL appears in print at the end of a sentence, and is therefore followed by a full stop, inexperienced web users might think that the full stop is part of the URL. If you leave out the final slash and the user ends the URL with a full stop (e.g. http://www.mywebsite.com/mystuff.), they will almost certainly be faced with a 404 Not Found error. If, however, you end your URL with a slash, if the user adds a full stop, the same page will appear as if they had not added it, although with a slightly less attractive URL.

A word of warning: don't overcorrect and put slashes at the end of URLs which end in a file name (such as http://www.mywebsite.com/mystuff/things.html).

By Natalie Catchpole

For more information on domain names and domain name registration questions please feel free to contact Domainmonster.com support team who will be happy to assist you.