Set pdf to download for Apache2
Tuesday, April 5th, 2011 Blog by ASROn Apache 2, this is all trivially easy. Just place the following in a .htaccess file in the same directory as your PDFs, and you’re done.
SetEnvIf Request_URI "\.pdf$" requested_pdf=pdf
Header add Content-Disposition "attachment" env=requested_pdf
This requires mod_headers, which is shipped with Apache2. On Ubuntu, it needs to be enabled with the “a2enmod headers” command.
