What is the difference between these two URLs:
Should we always add the final
/ or avoid it? Does it make a difference?
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
There's no difference between them. (As opposed to not putting a slash on links into a directory, for example.) I don't think I've ever seen anything saying that you should or shouldn't use a trailing slash for absolute URLs, though being consistent in your own behavior is generally not a bad idea either.
One of the most wasteful redirects happens frequently and web developers are generally not aware of it. It occurs when a trailing slash (/) is missing from a URL that should otherwise have one. For example, going to "http://astrology.yahoo.com/astrology" results in a 301 response containing a redirect to "http://astrology.yahoo.com/astrology/" (notice the added trailing slash). This is fixed in Apache by using Alias or mod_rewrite, or the DirectorySlash directive if you're using Apache handlers.
The other answers have identified that it doesn't seem to technically matter.
For me it is a matter of perception, if there is a trailing slash I'd expect something to be following it, a file name, an anchor.
I also think a lack of a trailing slash looks cleaner.
It's a matter of Apache configuration (can't say about others)
Some Apaches can't handle site/path as site/path/index.file
Semantically both URL declare the same resource