HTML and CSS Reference
In-Depth Information
How default pages work
Behind
the Scenes
The user types
http://www.starbuzzcoffee.com/drinks/
into the browser.
1
HTTP request: could I please
have the file “/drinks/”?
2
The server says, “That looks
like a directory; is there a
default file in that directory?”
3
5
HTTP response: you asked for
a directory, but I found “index.
html” in that directory, so that's
what I'm sending back.
starbuzz
<html>
.
.
</html>
drinks
index.html
www.starbuzzcoffee.com
Server locates a default
file called “index.html” in
the drinks directory.
4
Q: So anyone who comes to my site
with the URL http://www.mysite.com is
going to see my “index.html” page?
A: Right. Or, possibly “default.htm”
depending on which kind of web server your
hosting company is using. (Note that “default.
htm” usually has no “l” on the end. This is a
Microsoft web server oddity.)
A: Not. It's always better to leave it off.
What if, in the future, you change to another
web server and it uses another default file
name like “default.htm”? Or you start writing
scripts and use the name “index.php”? Then
the URL you originally gave out would no
longer be valid.
There are other possible default filenames,
like “index.php”, that come into play if you
start writing scripts to generate your pages.
That's way beyond this topic, but that doesn't
mean you won't be doing it in the future.
Q: So when I'm giving someone my
URL, is it better to include the
“index.html” part or not?
 
Search WWH ::




Custom Search