You are currently viewing Should You Add a / After a Hyperlink?

Should You Add a / After a Hyperlink?

Yep you should add a forward slash at the end of a link that goes to a web directory (note not a page with a .htm or something similar after it!) The reason is not widely known by most bloggers and basic web-masters like myself but I just found out why and it seems fairly important to get in the habit of doing long term when you are creating a web directory and/or and a hyper-link to it.

Normally, web directory links – (all web links to folders or files are called ‘URLs’) that point to files did not include the slash at the end whereas URLs that pointed at folders (web directories) did have the trailing slash added at the end. So to illustrate this look at these two URLs;

https://www.site.com/url-address/   is a link to a web directory
https://www.site.com/url-address    is a link to a file (like a PDF or something similar)

Now what I didn’t know was that the trailing / makes the web link and finding the resulting page faster! Here’s why; the trailing slash tells the web server to go to directly or folder or file (depending on whether you added the / or not) and crucially this means it does not have to go look up what kind of link it is! It knows from your ending / that its a directory and not a file making things faster all round. So leaving off the forward slash results in a redirect which means everything gets slowed down.

Best get in the habit of deciding what type of link it is you are creating – to a folder or to a file and adding the forward slash or leaving it off accordingly! Happy hyper-linking!