About This File
One of my websites was permanently frequented by 500-600 bots which put extra strain on my server for no return.
So i needed a solution to kick them out.
I found ip-bannliste.de which offer a frequently updated .htaccess file that kicks out known bad bots.
They have an auto updater php script that you can use manually or in conjunction with a cronjob to automatically update your .htaccess file.
I had 2 Problems with this approach:
- I wasn't really happy about having to setup a cronjob
- Since this script automatically overwrites the .htaccess file every X hours/days (you decide), it also overwrites any code you manually added to your .htaccess file. Which is a real problem for me.
So i addressed these two issues and released this improved version. Now you can:
- Include the auto updater directly into your cms (No need for a cronjob anymore since website visitors now trigger the update/script) (The script checks when the .htaccess file was last updated, it only updates it once every 24h)
- Add custom .htaccess code to an additional file which automaticall gets re-added after/during each .htaccess file update
Please note:
This improved Auto Updater is written by me / Michael Ernst (your-wbb.de, midnightmaster95.com) but the .htaccess File (Bot IP) Updates are still being provided by ip-bannliste.de aka beforesunrise.de
If you use a CMS like Wordpress oder Invision Community (basically every CMS these days) that automatically overwrites the core files on each update you need to write yourself a little plugin for the integration of this script. Otherwise it (the inclusion) will get removed each time you update your CMS.
Recommended Comments
There are no comments to display.