index.html files (Re: [Techtalk] Resolving a doman name)

Kai MacTane kmactane at GothPunk.com
Fri Jan 21 11:53:26 EST 2005


At 1/20/05 02:41 PM , Mary wrote:
>On Thu, Jan 20, 2005, Kai MacTane wrote:
> >
> > A couple of notes, to add to what Mary said: if the web server is properly
> > configured, you can just use:
> >
> > GET / HTTP/1.0
> >
> > instead of "GET /index.html HTTP/1.0". (Indeed, if "GET / HTTP/1.0"
> > produces an error, you've got something going wrong in your configuration.)
>
>Yeah, if you're going to want to address your website files by name,
>there's no real need to call them index.html.

Yeah. I was thinking that it would be really messed up to get an error if 
you go to "www.website.com/", but it works just fine if you do 
"www.website.com/index.html".

>I tend to like avoiding links to them, you can generally do:
>href="http://example.com/" instead of href="http://example.com/index.html"
>href="/" instead of href="/index.html" (that's a relative link to the
>root of your own domain)
>href="./" instead of href="index.html" (that's a relative link to the
>directory you're in)

Yeah, I've favored such things for years now, and considered it really naff 
to explicitly say "index.html" (or worse, "index.htm"!). I've looked at 
sites that do that as "these people don't really know URLs, do they?" But...

>The reason I like to do this is that the fact that the base file is
>stored in index.html is an implementation detail. One day you might want
>to store it in index.php.

This is a really good point. I hadn't considered the problems explicitly 
referencing "index.html" causes in website refactoring. Thanks for pointing 
that out!

                                                 --Kai MacTane
----------------------------------------------------------------------
"There is no faith in which to hide; even truth is filled with lies.
  Doubting angels fall to walk among the living.
  I'm in this mood because of scorn, I'm in a mood for total war.
  To the darkened skies once more, and ever onward!"
                                                 --VNV Nation,
                                                  "DarkAngel"



More information about the Techtalk mailing list