: What is the difference between a homepage link with or without a trailing slash? What is the difference between these two URLs: http://example.com/ http://example.com Should we always add the
What is the difference between these two URLs:
example.com/ http://example.com
Should we always add the final / or avoid it? Does it make a difference?
More posts by @Lengel546
4 Comments
Sorted by latest first Latest Oldest Best
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
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.
from: developer.yahoo.com/performance/rules.html
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.