Is there a way if a IE user comes on my website...I can make it display a completely diffrent page..from the users who use FireFox etc?

Is there a way if a IE user comes on my website...I can make it display a completely diffrent page..from the users who use FireFox etc?
Well i think an effective way to do it would be to use php.
Using conditional if statements you can create something along the lines of
That would include that file then it would die so that the rest of the page isn't displayed.PHP Code:<?
echo "
<!--[if IE]>";
include "internetexplorerfile.php";
die();
echo "
<![endif]-->
PAGE FOR OTHER BROWSERS SUCH AS FIREFOX HERE.
";
If not then you could just use
Both of them should work..HTML Code:<!--[if IE]> <meta http-equiv="refresh" content="0.1; url=http://INTERNETEXPLORERLINK.com"> <![endif]-->
Erm, Jack your first example won't work because you're mixing HTML and PHP, PHP doesn't take into account the conditional comments, you'll have to make an if statement in PHP for it to work. E.g.
also you can use javascriptPHP Code:<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== false)
{
header("Location: http://www.domain.com");
}
?>
furthermore you can use the user agent.Code:<script type="text/javascript"> if (navigator.appName === "Microsoft Internet Explorer") { window.location = "http://www.domain.com"; } </script>
As for the conditional comment as Jack postedCode:<script type="text/javascript"> if (navigator.userAgent.search(/MSIE/) !== -1) { window.location = "http://www.domain.com"; } </script>
This should do it if the browser supports the refresh like Jack posted, not sure if it has any drawbacks though. The other two you can have the browser user agent spoofed and people can simple disabled javascript so no solid way unless the conditional comment meta refresh works.Code:<!--[if IE]> <meta http-equiv="refresh" content="1;url=http://www.domain.com"> <![endif]-->
You're right, i made a well nooby mistakeErm, Jack your first example won't work because you're mixing HTML and PHP, PHP doesn't take into account the conditional comments, you'll have to make an if statement in PHP for it to work. E.g.
also you can use javascriptPHP Code:<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== false)
{
header("Location: http://www.domain.com");
}
?>
furthermore you can use the user agent.Code:<script type="text/javascript"> if (navigator.appName === "Microsoft Internet Explorer") { window.location = "http://www.domain.com"; } </script>
As for the conditional comment as Jack postedCode:<script type="text/javascript"> if (navigator.userAgent.search(/MSIE/) !== -1) { window.location = "http://www.domain.com"; } </script>
This should do it if the browser supports the refresh like Jack posted, not sure if it has any drawbacks though. The other two you can have the browser user agent spoofed and people can simple disabled javascript so no solid way unless the conditional comment meta refresh works.Code:<!--[if IE]> <meta http-equiv="refresh" content="1;url=http://www.domain.com"> <![endif]-->![]()
Iszak saves the day, once again.
Want to hide these adverts? Register an account for free!