What's the forward slash for at the end of a URL?

D

David Dorward

xyZed said:
www.widget.com
www.widget.com/

Which one is right and what's the difference?

Assuming you intended to put an "http://" on the front of those (since a
relative URL from a Usenet posting doesn't make much sense), then there is
no difference. They are just different ways of representing the same URL.

http://www.example.com/foo and http://www.example.com/foo/ would be
different though (the root of the domain is special). Which one is right
depends on the configuration of the server. Since such similar URLs are
confusing a well configured server will redirect one to the other (usually
foo to foo/ as that tends to map onto a directory containing an index.html
file).
 
A

Alan J. Flavell

www.widget.com

www.widget.com/

Which one is right and what's the difference? (please)

You talking about URLs published on the WWW? If so then both are
wrong, unless they're meant to be resolved as relative URLs[1]

If you meant http://www.widget.com versus http://www.widget.com/ then
both are correct. The "/" which separates the host part of the URL
from the local part of the URL is optional when the local part is
empty.

Don't confuse that with the trailing slash on, let's say,
http://foo.example/bar versus http://foo.example/bar/

Those are two distinct URLs, either or both of which *could* refer to
distinct resource(s) at the server. Which one(s) are correct depends
on your server configuration.

What did you *really* want to know? If you're referring to the sloppy
habit of typing incomplete URLs into your browser's URL bar, then the
rules are whatever the browser developer has implemented, since *that*
would be of purely local significance.

have fun

[1] in which case they'd be resolved relative to the absolute URL of
the page which referenced them, let's say
http://www.foo.example/some/path/to/www.widget.com , with or
without a trailing slash.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top