Bloccare richieste SPAM ad apache tramite mod_rewrite (tra cui i referer)

This item was filled under [ Howto, Linux ]

Vi è mai capitato qualche spammer che linka in un iframe il vostro sito per far saturare la banda?

Bene, i vostri problemi sono finiti :)

Mod_rewrite mette a disposizione numerosi strumenti per bloccare le richieste tramite referer. Questo è uno:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://12.163.72.13 [NC]
RewriteRule .* - [F,L]

In pratica blocchiamo l’accesso (via referer) alle nostre pagine dal sito con indirizzo IP 12.163.72.13.
Possiamo bloccare anche l’accesso tramite host:

RewriteEngine On
RewriteCond %{HTTP_HOST} arcor-ip.net$ [NC]
RewriteRule .* - [F,L]

Mettete il tutto nell’.htaccess del vostro sito ed il gioco è fatto.

via | bhatt.id.au

Tags

,

Popularity: 8% [?]

Leggi anche

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Comment on “Bloccare richieste SPAM ad apache tramite mod_rewrite (tra cui i referer)”

Trackbacks

  1. upnews.it

Leave a Comment