The facts about trailing slashes in URLs
Often when writing URL’s we put little thought into whether we add a trailing slash or not, especially these days with SEO where more concerned about the actual readability of the URL. The fact is webservers differentiate a request for a file and directory through the slash. When an incoming request comes through without a trailing slash even if there’s no extension (i.e. www.mysite.com.au/home) the webserver first tries to locate a file, only when its checked all files within the given directory does it then go on and check for a directory. While this is minor its still uneccessary overhead on the server when you consider a directory with hundreds of files.
So what does this mean in terms of SEO rewrites? Well not much because you can have whatever URL you want as long as you can translate it via some rule for the server. However, it is something to bear in mind if you dont want to give more meaning to your URLs. For instance, excluding this blog, these days for URL rewrites pointing to collections of things like Categories i usually end my URL’s with slashes category/politics/ and for single files I usually end my URLs with an 2008/01/17/keving07.html





