{{tag>webserver lighttpd}} ====== lighttpd force pdf download ====== In lighttpd, to disable PDF opening in browser, add following config files in //lighttpd.conf//. This is useful in increasing CTR as browsers usually get stuck while loading PDF files. $HTTP["url"] =~ "(.*)\.pdf" { mimetype.assign = (".pdf" =>"application/octet-stream") setenv.add-response-header = ( "Content-Disposition" => "attachment" ) } Dont forget to enable setenv module, if not already done … server.modules += ( "mod_setenv" ) service lighttpd reload ====== Tested on ====== * ====== See also ====== ====== References ======