简体   繁体   English

将IE8用户重定向到另一个页面

[英]Redirect IE8 users to another page

I am implementing a website with Wordpress, but my website is not supported in Internet Explorer 8. 我正在使用Wordpress实现一个网站,但我的网站在Internet Explorer 8中不受支持。

Is there any code I can use so that any IE8 users will be redirected to another page? 有没有我可以使用的代码,以便任何IE8用户将被重定向到另一个页面?

I know you specified PHP, but here's a HTML/JS solution: 我知道你指定了PHP,但这是一个HTML / JS解决方案:

<!--[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]> . 如果您特别只想重定向IE 8用户, <!--[if IE]>更改为<!--[if IE 8]>

Yes, in PHP you can use $_SERVER['HTTP_USER_AGENT'] to detect the browser and redirect accordingly. 是的,在PHP中,您可以使用$_SERVER['HTTP_USER_AGENT']来检测浏览器并相应地重定向。 In javascript you can you navigator.userAgent to apply the same thing. 在javascript中你可以使用navigator.userAgent来应用同样的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将用户重定向到另一个页面? - How to redirect users to another page? 网站链接已加载,但不会重定向到其他页面Wordpress,IE8 - Website links load but do not redirect to different page Wordpress, IE8 页面无法在IE8中正确呈现 - Page not rendering properly in IE8 当我在 IE8 中上传该表单的图像时,页面无法重定向 - Page can't be redirect when i upload image which that form in IE8 如何制作检测脚本,如果检测到旧的ie并重定向到另一页? - How to make detection script , if detect old ie and redirect to another page? 我需要根据输入的代码将用户重定向到另一个页面 - I need to redirect users to another page based on a code entered 如何将管理员重定向到特定页面并将用户重定向到另一个页面 - Laravel 8 jetstream - How to redirect Admin to a specific page and users to another - Laravel 8 jetstream 将用户重定向到登录页面 - redirect users to the login page 如何将未登录的用户重定向到登录页面并重定向到保存数据的另一个页面? - how to redirect non logged users to login page and redirect to another page with saved data? 如何将移动用户和PC用户重定向到另一个URL但位于同一网页中 - How to redirect mobile users and pc users to another url but are in the same web page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM