Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not able to find and way to set some header in .htaccess file only if the browser is IE9. Pseudo code for my requirement is:

if(ie 9) {
 header set ( value2)  
} else {
      header set ( value2)

Please suggest me how i can achieve this in my htaccess file.

share|improve this question

You could use BrowserMatch directive from mod_setenvif to set Apache environment variable and use this variable to set appropriate header value using mod_headers.

BrowserMatch "MSIE 9" MSIE9FOUND
Header set YourHeader value2 env=MSIE9FOUND
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.