如何在htaccess中将Microsoft Edge与Chrome分开? [英] How to separate Microsoft Edge from Chrome in htaccess?

查看:108
本文介绍了如何在htaccess中将Microsoft Edge与Chrome分开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的.htaccess文件中有此文件:

I have this in my .htaccess file:

RewriteEngine on

RewriteCond %{HTTP_USER_AGENT} Chrome
RewriteRule ^(.*)$ page.php [NC,L]

Microsoft Edge浏览器认为它是Chrome,然后转到page.php.有什么方法可以避免Edge使用Chrome命令,因此它不会转到page.php?

Microsoft Edge browser thinks it is Chrome and goes to page.php. Is there any way to avoid Edge from using the Chrome command, so it would not go to page.php?

我在Google上搜索了很多东西,却没有找到任何有关如何引导Edge浏览器的信息.有什么帮助吗?谢谢!

I have googled so much and I haven't found anything how to direct Edge browser. Any help? Thanks!!

推荐答案

边缘用户代理中包含边缘"一词,例如

The Edge user agent has the word Edge in it, e.g.

Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,例如Gecko)Chrome/42.0.2311.135 Safari/537.36 Edge/12.

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.

其中也包含Chrome一词,因此请将Edge的重写规则放在Chrome的重写规则之前.

It also has the word Chrome in it, so place a rewrite rule for Edge before the one for Chrome.

请注意,这是故意完成的(感谢@Axalix提供的链接)

Note that this was done intentionally (thanks to @Axalix for the link)

您今天访问的许多网站在IE中都无法很好地显示,因为它们的编码不正确,并且即使Internet Explorer 11支持许多新的Web标准,它们也通常会像在旧浏览器中一样显示页面.某些页面在IE中显示不正确,而在其他浏览器(例如Chrome或Firefox)上运行正常.

Many websites that you visit today will not display well in IE because they are not coded properly and usually display a page like they would in an old browser, even though Internet Explorer 11 supports many of the new web standards. Some pages will display incorrectly in IE while working perfectly fine on other browsers such as Chrome or Firefox.

因此,您可能不想像对待Chrome一样对待Edge.当然,不要只是假设它就像是IE的新版本.

So you may not want to treat Edge any differently than you do Chrome. Certainly don't just assume it's like a new version of IE.

有什么方法可以避免Edge使用Chrome命令,因此它不会转到page.php吗?

Is there any way to avoid Edge from using the Chrome command, so it would not go to page.php?

这不是命令,而是浏览器发送的用户代理标头.不,您不能阻止Edge浏览器发送用户代理发送的信息.

It's not a command, but a user agent header that the browser sends. No, you cannot prevent Edge browsers from sending the user agent that they do.

这篇关于如何在htaccess中将Microsoft Edge与Chrome分开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆