HTML and CSS Reference
In-Depth Information
How default pages work
the Scenes
The user types
into the browser.
HTTP request: could I please
have the file “/drinks/”?
The server says, “That looks
like a directory; is there a
default file in that directory?”
HTTP response: you asked for
a directory, but I found “index.
html” in that directory, so that's
what I'm sending back.
Server locates a default
file called “index.html” in
the drinks directory.
Q: So anyone who comes to my site
with the URL 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