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.