I have an interesting issue and I have not been able to find much about this by searching the web and forums.
I have a script that logs hits into a mysql database. I would like to be able to configure apache so that it will run my PHP script at the beginning of each request. This way I will also be able to capture 404 errors, non-php pages/items (gif/jpg etc.). Any ideas on how I could go about this?