如何根据查询字符串在apache mod_rewrite中禁止使用url?

jor*_*gen 13 apache mod-rewrite query-string

如何在apache中禁止以下url;

main/index.php?site=ing

我试过以下几点;

RewriteRule ^main/index.php?site=ing - [F]

但没有运气......

Vin*_*vic 16

无法比拟的重写规则的查询字符串,你必须做

RewriteCond %{QUERY_STRING} site=ing     #Adjust the regexps with anchors
RewriteRule ^main/index.php - [F]
Run Code Online (Sandbox Code Playgroud)