My WordPress site is under attack. A bot sends queries that crashes my MySql. All of them contains “/?s=” and “.pl” in the url, so, I whant to redirect to home if someone is trying to access them.
Example:
If www.example.com/?s=xxxxx.pl redirect to www.example.com/
If www.example.com/?s=123.pl redirect to www.example.com/
Can you help me? I couldn’t find how to edit .htaccess to solve it.
You could use a more robust system like mod_qos to stop these types of attacks then it will automatically block them by IP and other ways.
However you can do something like this with rewrite rule and then it will get 403 forbidden.
if you still want to redirect to home page you can do this.
Let me know how this works for you.