apache html请求参数
是否有任何方法可以禁用/删除对html内容的查询apache html请求参数,apache,ddos,Apache,Ddos,是否有任何方法可以禁用/删除对html内容的查询 GET /alaswaq_property.html?d691f GET /alaswaq_property.html?48fae GET /alaswaq_property.html?8c106 GET/alaswaq_finance.html?fe082如果请求包含filename.html?xxx,则阻止它只允许filename.html
GET /alaswaq_property.html?d691f
GET /alaswaq_property.html?48fae
GET /alaswaq_property.html?8c106
GET/alaswaq_finance.html?fe082如果请求包含filename.html?xxx,则阻止它只允许filename.html<这是可能的吗
提前感谢。在您的htaccess文件或vhost配置中,添加:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^[A-Za-z0-9]{5}$
RewriteRule \.html$ - [F,L]
如果只想包含任何查询字符串,请将RewriteCond
行更改为:
RewriteCond %{QUERY_STRING} !^$
是的,您可以使用mod_rewrite来执行此操作
RewriteRule ^/alaswaq_property.html /alaswaq_property.html?
有关查询字符串操作可以执行的操作,请参阅。如果要对所有.html文件执行操作,请参阅?重写规则的语法将是?@Jahil我编辑了答案,刚刚意识到您需要所有html文件。如何处理上述条件下超过5个字符?@Jahil您可以更改正则表达式
{5}
,如果您希望介于5和10之间,{5,10}
,或者一个或多个+