Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: martinibuster
(1) it doesn't cost you anything to do it
(2) it ensures that spider programs have no excuses about having problems crawling past that link.
(3) there's an unlikely problem that Apache web servers can have if you leave it off.
more info at [httpd.apache.org...]
All the same, there are good technical reasons to always include it anyway. A full URL specifies a resource on the net by (at least) three parts:
Now what happens if one of those parts is left away?
If the protocol is left away, the browser will assume http.
If the hostname is left away, the host that served the current document is assumed (relative URLs).
If the path is left away, then most browsers won't do anything about it.
This means, that they'll send the request to the server without the /. Since the server can't send a document without a path (such a document doesn't exist), it will then assume that the client actually meant the root path of its namespace. However, it will not simply send that document. Instead it will send a 301 redirect reply, asking the client to repeat its request with the / included.
The result is, that for such an URL, not one request has to be sent, but two. Therefore, if you want the pages you specify with your URLs to load faster and with less strain on the network, make sure to always include a path. If you don't, then the server will most likely correct your omission, but it will cause more work for all systems involved.
He advises leaving the / in your HTML, because if you just put (say) mydomain.com/news the server has to perform one more lookup operation to discover that that mydomain.com/news maps to the directory mydomain.com/news/ rather than to a file. This adds a tiny bit to retrieval time. Some people would say this doesn't matter, but it's one of those things: if you chop out ten or fifteen things that cause a tenth of a second delay in loading your page, then people subliminally start noticing that your page loads faster.
And by contrast, any address printed or displayed for human consumption should not include the trailing slash: a reader of the page should just see mydomain.com/news, which is cleaner and easier to remember (the code behind the link can include the trailing slash).
I always wondered why the ses coming to index often appeared to log my root twice, now I know why. I manually submit and always removed the trailing /, now I won't!
Always makes me happy to reduce bandwidth load, (however miniscule) rather than contribute to it!
A most informative thread. Thanks to everyone.
cheers and hooroo