in reply to Viewing .dat files

Tell your web server the content type is text/plain. This could be done in an Apache .htaccess as follows:
<Files *.dat> ForceType text/plain </Files>

Untested.

Replies are listed 'Best First'.
Re^2: Viewing .dat files
by mwah (Hermit) on Oct 08, 2007 at 17:37 UTC
    ikegami :
     ...
     ForceType text/plain
     ...
    
    Such solutions won't work if the document root
    is away from the script path. There won't be any
    allowed accesses into /cgi-bin/ without extra configuration
    (which you don't really want to do this way).

    You won't get around sth. in the lines of this: Re: Viewing .dat files

    Regards

    mwa

      If ScriptAlias causes problems with ForceType, a more sensible solution would be to put the .dat in another directory rather than breaking caching, HEAD requests, conditional requests, partial requests, etc by reimplementing the wheel.

      I particularly like how your script checks if a file exists but returns 200 OK either way.

A reply falls below the community's threshold of quality. You may see it by logging in.