Forum Moderators: coopster
As I am slightly concerned that
a. My htaccess file will get bloated
b. Someone with bad intent is doing stuff from their own machine via an AOL or similar proxy
I am trying to create a script that will open my htaccess file once a week and either
a. Write my htaccess instructions to it, thereby clearing out the banned ip's
or
b. Help clear out the SetEnvInf lines with banned ip's.
Is such a script around or does anyone have an idea how to get this done? Once I've got the script runnning I can just ask my host for a cronjob on it.
Any help is MUCH appreciated!
Thank you
Joe Belmaati
Copenhagen Denmark
I would store this outside of the root as well to keep it from being accessible via the web.
Then you could set up a crontab to run a little clean up script once a week.
the logic would be something like
1. open default_htaccess.txt for reading
2. get contents of file
3. close default_htaccess.txt
4. open .htaccess for writing, which will truncate the file to zero length
5. write the default htaccess to it
6. close .htaccess
7. maybe send email to you to tell you all was successful or give you any errors that occurred
1. copy .htaccess to .htaccess_temp (details above)
2. rename .htaccess_temp to .htaccess, thereby replacing the old .htaccess file
3. maybe send email to you to tell you all was successful or give you any errors that occurred
To avoid problems, think, "What could go wrong?"... It will. Plan on it.
Jim