[Doc-SIG] HTML puzzle

Simon Budig Simon.Budig@unix-ag.org
Mon, 5 Aug 2002 23:11:20 +0200


David Goodger (goodger@users.sourceforge.net) wrote:
> I've been fiddling with the stylesheet for Docutils output, and I came
> across something strange in Netscape 4.7 (MacOS).  I've reduced it to one
> variable: web server.

Yep, it is a web server issue on the sourceforge site.

Some relevant bits from the http-conversation:

> I've copied the HTML and stylesheet for PEP 257 from
> python.org to docutils.sf.net, so I'm looking at the exact same data, but
> they render differently.  Here are the two URLs:
> 
>     http://www.python.org/peps/pep-0257.html

simon@ping-pong:~$ telnet www.python.org 80
HEAD /peps/style.css HTTP/1.0
Host: www.python.org 

HTTP/1.1 200 OK
Content-Type: text/css

>     http://docutils.sf.net/spec/pep0257.html

simon@ping-pong:~$ telnet docutils.sf.net 80
HEAD /spec/style.css HTTP/1.0 
Host: docutils.sf.net

HTTP/1.1 302 Found
Content-Type: text/html; charset=iso-8859-1

> Can anyone reproduce or explain this?

Yes. The sourceforge server does not label the style.css as the content
type text/css, it instead serves this as text/html which is wrong. Some
browsers might choose to ignore/misinterpret the stylesheet when the
webserver announces it as HTML instead of CSS.

I am not sure how liberal the sourceforge server is, it definitely
should serve files ending in .css as text/css. *Maybe* (probably not) you
can override this with a .htaccess in the webdirectory containing
the line

AddType text/css .css

If the administrators of sourceforge do allow .htaccess-files this
should make the apache specify the correct content type.

Hope this helps,
        Simon
-- 
      Simon.Budig@unix-ag.org       http://www.home.unix-ag.org/simon/