[sf-lug] need for .html suffix

Rick Moen rick at linuxmafia.com
Mon Jun 11 22:00:24 PDT 2012


Quoting Alex Kleider (a_kleider at yahoo.com):

> I've just come across some puzzling behavior as follows.
> index.html (parent page) contains an href to a file in the same directory.
> Whether the referenced file is called index.khan or k1.html makes no
> difference if I test locally (i.e. point browser @
> file:///home/alex/BookSite/index.html and then click on the link) but
> once uploaded to the server, if that file doesn't have the suffix
> '.html', the browser/server relationship breaks down and I get a
> notice that my link is to a bin file and I am given the option to save
> it but it won't display.  Should I have expected this?

In a word, yes.

/etc/lighttpd/lighttpd.conf will have a set of 'mimetype.assign'
directives by filename extension.  If you really need to, you can add
additional mappings, but it'd be better if you just used conventional
filename extensions.

FWIW, you probably also have these lines in it, which control what
files, if present, as parsed as a directory's index file and shown to
the user:

# files to check for if .../ is requested
server.indexfiles          = ( "index.php", "index.html", 
                                "index.htm", "default.htm" )





More information about the sf-lug mailing list