Alan Skorkin has written a wonderful piece entitled What Every Developer Should Know About URLs. It’s a very long, detailed post, but if you have to work with URLs you should give it a read.
To most of us, a URL is a pretty straightforward thing. They usually look like http://www.something.com, but you’ll likely have noticed that there is a great deal of additional complexity that is added into URLs depending where you are on the web. The real structure of a URL, as Alan points out, looks like this:
That’s just the tip of iceberg though. If you go and read his article, you’ll find that he’s covered this topic in depth and you’ll come out of it with a much better understanding or the makeup of a URL and what mistaken assumptions you may have.