0

All browsers are not equal. Hence I need to explicitly state that I have a favicon ("shortcut icon") for mod_autoindex-generated pages. How can I do that?

Using header (HeaderName) and footer (ReadmeName) is not an option because those get included into the HTML-body. I need to manipulate the <head> part of the generated HTML.

Edit 1: The first reply states to use /favicon.ico. This is not a solution either, because as I stated above not all browsers request that file automagically. I have a very stubborn Firefox 8.0 here that refuses to load it for example. This can be seen in the server logs (missing HTTP request for that existing and readable file - yes, it works in Opera, for example) and and in FF itself (with the Live HTTP headers addin). No HTTP request to the server, which cannot logically be explained with the /favicon.ico not being readable.

2 Answers 2

3

Add the IndexOptions +SuppressHTMLPreamble option to the .htaccess file to suppress mod_autoindex's automatic injection of the preambulatory <html><head></head><body> tags and then include those tags and your desired <link> tag in your Header.html file.

This option is available in Apache 1.3 and later.

2

All browsers request "/favicon.ico" at least once when you visit a web host.

Just create it.

5
  • Actually they don't. I have a very stubborn Firefox 8.0 here that refuses to behave as you say. Can be seen both in the server logs and FF itself (with the Live HTTP headers addin). I'll edit that into my question, as I was aware of Opera doing that request on /favicon.ico. Dec 8, 2011 at 18:23
  • 1
    That means it could not read the file. Fix the file permissions.
    – adaptr
    Dec 8, 2011 at 18:24
  • Right, so the file permissions on the server are responsible that the browser doesn't even request the file in the first place? Don't think so! What's wrong with the nickname? Dec 8, 2011 at 18:45
  • I just visited Google.com in FF8, which specifies no favourites icon, and it fetched /favicon.ico just fine. Fix your broken FF install first.
    – ceejayoz
    Dec 8, 2011 at 18:51
  • @ceejayoz: thank you. It's not a broken installation but rather one of the add-ons. I disabled all but Live HTTP headers and voila it works. I'll accept the response, but will probably edit it with the details of the add-on causing this effect. Dec 8, 2011 at 19:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .