如何只允许上的.htaccess一个用户代理?只允许、用户、htaccess

2023-09-02 09:40:56 作者:花开雨落又逢春

我一直在寻找全国各地谷歌,我真的需要知道如何只允许一个用户代理上的.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.

 
精彩推荐
图片推荐