Jump to content

Htaccess Multiple Condition Check


plastik77

Recommended Posts

Hi, I am trying to force PDF files to download when the user's browser is IE, but display in the browser for all other cases. I have the PDF download part working, but not sure how to combine this with the browser check. Any ideas? Thanks

 

This is what I have currently but obviously doesn't combine the conditions

 


SetEnvIfNoCase User-Agent (Opera|Chrome|Version|Firefox|MSIE)[\/|\s](\d+)\. browser=$1 version=$2
SetEnvIf browser MSIE browser=IE
SetEnvIf Request_URI "\.pdf$" requested_pdf=pdf
Header add Content-Disposition "attachment" env=requested_pdf

Link to comment
https://forums.phpfreaks.com/topic/270422-htaccess-multiple-condition-check/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.