Published in Search Engines on Friday, July 16th, 2004
What is the right thing to do about trailing slashes? A look at some links and examples, and what is Yahoo! up to?
I originally became aware of the issues surrounding trailing slashes in article #138 of Alistapart, "Slash Forward (Some URLs are Better Than Others)". Kyler Laird provides some additional information about trailing slashes.
Having read those and put them to work (over two years ago now), I felt reasonably comfortable about how I dealt with URL's. Unfortunately, some doubt has been cast over my previously comfortable state, seeing respected peers laughing in the face of convention.
Note: Simon likely gets away with it in the way that he has programmed his site and written his re-write rules... He has been observed in the commenting wild supporting the use of the trailing slash.
Now admittedly, (sounding like a big geek here) the url's sans trailing slash do look cooler, but if the lack of a trailing slash can result in a performace issue, how is it that a site like Yahoo! chops the trailing slash off of urls that don't end with file extensions?
Look closely at the urls of the search results (both the green ones and the urls in their anchors), and if you don't have a file extension, no trailing slash for you!
For the record, Google includes the trailing slash.
Given the inconsistencies, what is right and what is wrong?
I started freelancing by diving in head first and getting on with it. Many years and a lot of experience later I was still able to take away some gems from this book, and there are plenty I wish I had thought of beforehand. If you are new to freelancing and have a lot of questions (or maybe don't know what questions to ask!) do yourself a favor and at least check out the sample chapters.
Like the other books listed here, this provides a great reference for the PHP developer looking to have the right answers from the right people at their fingertips. I tend to pull this off the shelf when I need to delve into new territory and usually find a workable solution to keep development moving. This only needs to happen once and you recoup the price of the book in time saved from having to develop the solution or find the right pattern for getting the job done..