如何只允许上的.htaccess一个用户代理? [英] How to only allow one user agent on .htaccess?
本文介绍了如何只允许上的.htaccess一个用户代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在寻找全国各地谷歌,我真的需要知道如何只允许一个用户代理上的.htaccess?
I have been searching all over google and I really need to know how to only allow one user agent on .htaccess?
我所发现的是怎么做的专用或专用服务器上。
All I found is how to do it on a Dedicated or private server.
推荐答案
如果您希望允许用户代理是:山猫/ 2.8.8dev.12
If the user-agent that you want to allow is: Lynx/2.8.8dev.12
然后要限制要在目录中的htaccess的规则:
Then you want these rules in the htaccess of the directory you want to restrict:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !Lynx/2\.8\.8dev\.12 [NC]
RewriteRule ^ - [F,L]
每用户代理禁止使用403。
Every other user agent is forbidden with a 403.
这篇关于如何只允许上的.htaccess一个用户代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文