Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment
up vote 0 down vote accepted

Found a way to do it by doing:

try_files $uri /msie.html;
share|improve this answer
add comment

Your Answer

 
discard

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.