A quick and dirty!
I tried to get it to a one-liner but I must've missed something. This way works at least.
Create a file that is called "edit.sh" and add this to it:
Quote:
#!/bin/bash
echo "Deny from someip" >> $1
echo "RewriteRule .*\.(gif|GIF|Gif|jpg|JPG|jpeg)$ http://www.mydomain.com/error.jpg [R,NC]" >> $1
|
The ">>" will append the text to the .htaccess. Change it to ">" if you want to over write.
Change the file to "chmod 755 edit.sh".
Now run this from the main directory where you can find the .htaccess files:
Quote:
|
find . -name .htaccess -maxdepth 2 -exec ./edit.sh {} \;
|
Change "./edit.sh" to the correct path to edit.sh.
"-maxdepth 2" will only look for .htaccess maximum 2 directories deep, change to suit your needs.
DISCLAIMER!
If you fuck up, I'm not responsible
It worked for me. So try it in a test directory first and see if it will look the way you want it.