I'd like to take elitism to the n-th degree by not allowing Internet Explorer to browse my website.
Is there a way to do such a thing? My website is built upon the CakePHP framework, if that helps.
I'm pretty sure all IE versions support the following - does require JavaScript though.
<!--[if IE]>
<script type="text/javascript">
window.location = "http://www.google.co.uk/chrome"
</script>
<![endif]-->
If you want to do it in PHP, you can use the $_SERVER['HTTP_USER_AGENT']
variable to read in the user agent and then look to see if it's using IE, and stop loading if so. You'd want to use a regex on the string, with a simple example being:
if (preg_match("Internet Explorer", $_SERVER['HTTP_USER_AGENT']) == 0) {
// print message or whatever and abort
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With