How to Redirect all IE users to a new page

My programmer is on vacation so I need your help! I discovered a page that has a bug for IE users. I want to redirect all IE users to a different page.

How can I do this? I searched all through Google and Stackoverflow and cannot find an answer. (I found some scripts, and tried them, but none worked).

Answers


Try:

<!--[if IE]>
<script type="text/javascript">
window.location = "http://www.google.com/";
</script>
<![endif]-->

Or, a non-JS solution, put the following in your head section:

<!--[if IE]>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.google.com">
<![endif]-->

I put this in header and it works for all IE versions:

<!-- For IE <= 9 -->
<!--[if IE]>
<script type="text/javascript">
    window.location = "https://google.com";
</script>
<![endif]-->

<!-- For IE > 9 -->
<script type="text/javascript">
    if (window.navigator.msPointerEnabled) {
        window.location = "https://google.com";
    }
</script>

For Internet Explorer 10 this one works well

<script type="text/javascript">
   if (navigator.appName == 'Microsoft Internet Explorer')
   {

      self.location = "http://www.itmaestro.in"

   }
</script>

A reminder that the [if IE] solution does not apply to IE 10 or greater. This can be very annoying for "features" that have not been fixed by IE 10. I am going to try the php and java solutions and re-comment.


Server-side solution using PHP that's guaranteed to work on all browsers:

<?
if ( preg_match("/MSIE/",$_SERVER['HTTP_USER_AGENT']) )
        header("Location: indexIE.html");
else
        header("Location: indexNonIE.html");
exit;
?>

Support for conditional comments has been removed in Internet Explorer 10 standards

I'm use this dirty hack for redirecting IE10+ users

<script type="text/javascript">
    var check = true;
</script>
<!--[if lte IE 9]>
<script type="text/javascript">
    var check = false;
</script>
<![endif]-->
<script type="text/javascript">
    if (check) {
        window.location = "page_for_ie10+.html";
    }
</script>

Need Your Help

Duplicating objects in Java

java variables object pointers reference

I learned that when you modify a variable in Java it doesn't change the variable it was based on