css - 互联网浏览器 : Disable Access from Visitors

标签 css html internet-explorer web browser

有没有办法在有人使用 IE 浏览时禁止访问我的网站?最好是将他们重定向到一个漂亮的登录页面,您可以在其中解释为什么无法访问。

我正在为我的元素使用 Laravel =)。

干杯, 斯坦

最佳答案

尝试

PHP 有函数 $_SERVER['HTTP_USER_AGENT'] 用来识别浏览器

 if(using_ie())
 {
   //redirect
 }
function using_ie() 
    { 
        $u_agent = $_SERVER['HTTP_USER_AGENT']; 
        $ub = False; 
        if(preg_match('/MSIE/i',$u_agent)) 
        { 
            $ub = True; 
        } 

        return $ub; 
    } 

你也可以用

if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
  header('Location: /index-ie.php');
  exit;
}

关于css - 互联网浏览器 : Disable Access from Visitors,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54333391/

相关文章:

html - DocType 导致 CSS 无法识别

html - 将滚动条放在内容区域

html - 使用填充将 child 绝对定位在 parent 内部

html - 如何让 flexbox 填充 100% 的高度

html - 如何在html中将图像的位置设置为居中

javascript - jQuery 选择器转义冒号 ":"在 IE 中有效,但在其他地方不起作用

javascript - 检测浏览器是否支持 vbscript?

jquery - 图像边框和 ResponsiveSlides.js

javascript - 从 div 悬停到 UL 时保持 UL 可见

php - 无法使用带有 php 的 Selenium 将 cookie 添加到页面