httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Wigg <>
Subject Re: [users@httpd] How to force CRLF on non .txt files when directory browsing?
Date Fri, 12 Feb 2010 09:48:10 GMT
On 9 February 2010 19:51, Jonathon Veencamp <> wrote:
> I don't think it's a poor editting thing.  I think this is the difference
> between Unix and Windows and CR/LF on Windows versus LF on Linux.  The HTTP
> server is adding CR/LF to .txt files to display them correctly in the
> browser.  But I can't get it to display .log files in the same manner.

I think this is probably a Windows thing and not to do with the web
server configuration at all. Internet Explorer seems to go through
quite a complex process to decide what to do with specific file
extensions that doesn't just rely on the Content-type header sent by
the server.

You could always do some horrendous hack like so...

# Externally rewrite .log files to .log.txt
RewriteEngine On
RewriteCond %{REQUEST_URI} \.log$
RewriteRule (.*) $1.txt [L,R]

# And internally rewrite them back again, thus fooling IE.
RewriteCond %{REQUEST_URI} \.log\.txt$
RewriteRule (.*)\.txt$ $1 [L]


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message