Re: [SOLVED] Text files treated like html in apache 2.4
On Tue, May 13, 2014 at 06:59:17PM -0400, Stephen Powell wrote:
> On Mon, 12 May 2014 20:28:24 -0400 (EDT), Stephen Powell wrote:
> > ...
> > But with Apache 2.4, it treats the text file like html and reformats
> > everything, concatenating lines, eliminating blank lines, etc. How do
> > I get it to treat plain text like plain text again?
>
> Well, the joke is on me. The text file I was trying to view was a
> Windows-style text file, with each line (except the last) ending in
> a <CR><LF> combination. But it was being served up by Apache running
> on Linux. Linux-style text files have each line (except the last)
> end with only a simple <LF>. This apparently confused Microsoft
> Internet Explorer and it did not recognize it as a plain text file.
> The solution was simple enough:
>
> sed -e 's/^V^M$//' file.txt >newfile.txt
> rm file.txt
> mv newfile.txt file.txt
Even simpler:
apt-cache show dos2unix :)
--
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the
oppressing." --- Malcolm X
Reply to: