Redirect IE8 users to another page

孤街醉人 提交于 2019-12-05 15:56:57
Danny Beckett

I know you specified PHP, but here's a HTML/JS solution:

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

Taken from this answer.

If you specifically only want to redirect IE 8 users, change <!--[if IE]> to <!--[if IE 8]>.

Yes, in PHP you can use $_SERVER['HTTP_USER_AGENT'] to detect the browser and redirect accordingly. In javascript you can you navigator.userAgent to apply the same thing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!