Search code examples
.htaccesshttpsecurityspam-prevention

Ban an ip automatically after repeated suspicious attempt via .htaccess mod rewrite


I've been tracking traffic to my website and lately I have been seeing deliberate attrmpts to find a weak spot, specofically in this case, trying various combinations of http:/// + random file names/extensions

So, if I made a "patter recognizer" that detected various domain searches that did not match any that existed, or even just the http:/// part, how could I trigger an automatic .htaccess block?


Solution

  • Blocking odd URLs via .htaccess is pointless as you'll only be blocking things that are already safe. This could lead to a false sense of security or, worse, bad security where you're only protected in the specific case and not the more general case.

    Instead, make sure the server installation is well configured so you don't have to worry about those things.