最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Redirect IE8 users to another page - Stack Overflow

programmeradmin0浏览0评论

I am implementing a website with Wordpress, but my website is not supported in Internet Explorer 8.

Is there any code I can use so that any IE8 users will be redirected to another page?

I am implementing a website with Wordpress, but my website is not supported in Internet Explorer 8.

Is there any code I can use so that any IE8 users will be redirected to another page?

Share Improve this question edited Mar 21, 2013 at 15:31 Danny Beckett 20.8k25 gold badges112 silver badges142 bronze badges asked Mar 18, 2013 at 7:13 SemperFiSemperFi 2,3786 gold badges34 silver badges52 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 16

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.

发布评论

评论列表(0)

  1. 暂无评论