Search code examples
apacheddos

apache html request parameters


is there any way to disable/drop queries to html contents.

GET /alaswaq_property.html?d691f
GET /alaswaq_property.html?48fae 
GET /alaswaq_property.html?8c106

GET /alaswaq_finance.html?fe082 if request contains filename.html?xxx then block it only allow filename.html < is this possible?

thanks in advance.


Solution

  • In your htaccess file or vhost config, add:

    RewriteEngine On
    RewriteCond %{QUERY_STRING} ^[A-Za-z0-9]{5}$
    RewriteRule \.html$ - [F,L]
    

    If you want to simply include any query string at all, change the RewriteCond line to:

    RewriteCond %{QUERY_STRING} !^$