Tom Tom - 1 year ago 61
HTML Question

How to redirect Internet Explorer users to a new page?

I have tried using the following script

[if IE]
<script type="text/javascript">
window.location = "error.html";

It works like a treat apart from the fact that other browsers such as Chrome are also redirecting to the error.html page. What is wrong with it? Thanks

Answer Source

Try this:

<script type="text/javascript">
if(navigator.appName.indexOf("Internet Explorer")!=-1 || navigator.userAgent.match(/Trident.*rv[ :]*11\./))
   //This user uses Internet Explorer
   window.location = "error.html";

Greetings from Vienna

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download