.htaccess how to block specific url

9.5k views Asked by At

I suffered an attack on the site. a spammer has created a proxy that begins with a page 487032.asp on different domains can I stop into .htaccess all requests from url containing the string 487032.asp? How?

e.g. deny from *487032.asp

thank's

Mario

2

There are 2 answers

0
anubhava On

Create this rewrite rule in your .htaccess for blocking this bad URL:

RewriteEngine On

RewriteCond %{THE_REQUEST} /487032\.asp [NC]
RewriteRule ^ - [F]
1
Amit Verma On

Try :

<FilesMatch ".*487032\.asp$">
Order Allow,Deny
Deny from all
</FilesMatch>