DiMono wrote:
As far as I know, and I seem to recall links on this forum being changed because of it, if you try to go to www.example.com the server redirects you to www.example.com/, because that's where the site's home page is located. That's why you will never see in your URL bar www.example.com without the / at the end.
(Straying indeed a bit more off-topic, since Schik posted while I was typing this and I really don't want to throw out what I typed already...)
Ummm... the change in the URL bar is caused by your browser; it'll add the protocol
http://) and a single slash as the path if it's missing...
Let me just wireshark what happens when I type "
slashdot.org"
into Firefox' URL bar:
GET / HTTP/1.1
Host: slashdot.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.11)
Gecko/20070312 Firefox/1.5.0.11
...
HTTP/1.1 200 OK
Date: Thu, 19 Apr 2007 16:37:53 GMT
Server: Apache/1.3.37 (Unix) mod_perl/1.29
SLASH_LOG_DATA: mainpage
X-Powered-By: Slash 2.005000154
X-Bender: But-- those girls don't wear cases! You can see their bare circuits!
Cache-Control: no-cache
Pragma: no-cache
Vary: User-Agent,Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1
Content-Encoding: gzip
...
See? No redirect, but my URL bar reads "
http://slashdot.org/ "
anyway...
If you don't specify any path in your URL (not even /), your browser will add the default "
/"
one.
On the other hand, if you specify a directory on a server without a trailing slash, the server usually sends a redirect (unless you turn that off) since relative links in HTML are based on the path up to the last slash, which usually means cutting off the current page's name.
But if the last part is that of the current directory and you chop it off, relative links are falsely based on the current directory's parent directory, thus the redirect.
Hey, if you still don't believe me, install Wireshark and experiment with it...
np: Radiohead - 15 Step (Live at Bayside Embarcadero, San Diego CA (27.06.2006))
____________________________
"
I'm not anti-anything, I'm anti-everything, it fits better."
- Sole
R.I.P. Robert Feldhoff (1962-2009)
[Last edited by Briareos at 04-20-2007 08:55 AM : Linewrap for teh readability win!]