httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Wigg <p...@philipwigg.co.uk>
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 <jdveencamp@gmail.com> 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.

http://msdn.microsoft.com/en-us/library/ms775148(VS.85).aspx

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]

Cheers,
Phil.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message