本文介绍了htaccess拒绝特定的get参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想拒绝访问特定的IP。我尝试了此htaccess代码,但没有成功:

I want to do deny access to specific ip. I tried this htaccess code but didn't worked:

<Files "index.php?action=deny">
Order Allow,Deny
Deny from XXXX
Allow from all
</Files>

其中XXXX是IP地址。我该怎么做,所以它只会拒绝特定的get参数,而不是整个文件?

where XXXX is an ip address. how can I do something like that, so it will deny only specific get parameter and not the whole file?

推荐答案

您在文件指令具有误导性。如果要使用 action = deny 查询参数匹配URL;您需要使用:

Your pattern in Files directive is misleading. If you want to match the URL with action=deny query argument; you'd need to use <Location>:

<Location /index.php?action=deny>

这篇关于htaccess拒绝特定的get参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 08:20