R
R
Roman2019-03-20 16:22:37
Apache HTTP Server
Roman, 2019-03-20 16:22:37

How to make Apache2 give a text file as a file, and not output it to the browser as text?

Hello.
There is Apache 2.4 and a text file in public:
translate.de
what to write in .htaccess so that the browser downloads the file to the computer, and does not output it as plain text?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentin, 2019-03-20
@procode

Try it
either way

<Files *.txt>
    ForceType application/octet-stream
    Header set Content-Disposition attachment
</Files>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question