Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 want to redirect IE users to a static file, regardless of what page they were trying to reach.

My code is inside a server block:

if ($http_user_agent ~* msie ) { rewrite ^.+$ /msie.html last; }

No matter what I try, I either get a 404 or a 500 Internal Server Error. Am I doing this correctly?

share|improve this question

Above answer doesn't work any more for IE11 because string "MSIE" isn't available any more in user agent string.

Sample IE11:

Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko

Sample IE9:

Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
share|improve this answer
up vote 0 down vote accepted

Found a way to do it by doing:

try_files $uri /msie.html;
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.