I recently deployed a beta version of one of my projects.
A few days went by and then I started getting 404 email notifications to my inbox. It seems that someone was trying to exploit known PHP issues (eg. phpMyAdmin issues, as seen in the picture below)
Here is how I solved this issue:
- Make sure you have mod_rewrite enabled for your Apache
- Write a rule in your VirtualHost that looks like this:
1 2 3 4 5 6 | <VirtualHost *:80> ServerName example.com DocumentRoot /path/to/example.com/current/public RewriteEngine On RewriteRule ^.*.php$ 404.html [R] </VirtualHost> |
This will redirect any *.php requests to your 404.html and save resources in your server.

