How to only allow one user agent on .htaccess?

£可爱£侵袭症+ 提交于 2019-12-03 14:47:36

If the user-agent that you want to allow is: Lynx/2.8.8dev.12

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]

Every other user agent is forbidden with a 403.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!