how to block requests with specific string using .htaccess in apache

By | November 12, 2019
Spread the love

These days common problem of hacking of website by hacker with scrips. They always use some common method or string to hack it. Now you can prevent these requests by adding some simple .htaccess rules.

You could send a 403 Forbidden (access denied) in case -admin is requested :

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/(.*?)admin
RewriteRule ^(.*)$ - [F,L]