.htaccess文件中所有其他哇再不是有些浏览器浏览器、文件、再不是、htaccess

2023-09-02 00:37:17 作者:成全比深爱更需要勇气

我有这个code:

 的RewriteCond%{HTTP_USER_AGENT}(领航员)[NC]
重写规则^ newfolder /(.*)$ /index.html [L,NC]
 

我EM intresting在第一线 - 如何把所有其它的浏览器谁不NAVIGATOR? Somethung喜欢的:

 的RewriteCond%{HTTP_USER_AGENT}(领航员)[NC]所有其他人都没有导航仪!
 

解决方案 百度浏览器是默认浏览器,qq也设置了不用qq浏览器打开,但是打开qq空间和邮箱的依旧是ie

您可以使用否定的RewriteCond

 的RewriteCond%{HTTP_USER_AGENT}(歌剧|导航|野生动物园)!
重写规则^ newfolder /(.*)$ /index.html [L,NC]
 

PS;注意到的RewriteCond%{HTTP_USER_AGENT}!导航,这意味着所有的用户代理,除了导航

I have this code:

RewriteCond %{HTTP_USER_AGENT} (navigator) [NC]
RewriteRule ^newfolder/(.*)$ /index.html [L,NC]

I em intresting in first line - How to put ALL OTHERS BROWSERS WHO ARE NOT NAVIGATOR? Somethung like:

RewriteCond %{HTTP_USER_AGENT} (navigator) [NC] ALL OTHERS WHO ARE NOT NAVIGATOR!

解决方案

You can use negation in RewriteCond:

RewriteCond %{HTTP_USER_AGENT} !(opera|navigator|safari) 
RewriteRule ^newfolder/(.*)$ /index.html [L,NC]

PS; Take note of RewriteCond %{HTTP_USER_AGENT} !navigator which means all user agents except navigator.