This is the 1st errors in my logs:
failed to open log file
fopen: Permission denied
[Thu Jan 23 02:13:13 2003] [error] [client xxx.xxx.xxx.xxx] Premature end of script headers: /home/virtual/site139/fst/var/www/cgi-bin/trap.pl
This is the second one that I resolve by removing the htaccess file:
[Thu Jan 23 02:23:56 2003] [alert] [client xxx.xxx.xxx.xxx] /home/virtual/site139/fst/var/www/html/.htaccess: Redirect URL not valid for this status
This is my htaccess file:
# Ban .htaccess & .htpasswd requests
SetEnvIfNoCase Request_URI \.ht(access¦passwd)$ ban
<Files ~ "^.*$">
order allow,deny
allow from all
deny from env=ban
</Files>
Options +FollowSymLinks
ErrorDocument 404 [yourdomain.com...]
Redirect 301 /home/virtual/site139/fst/var/www/cgi-bin/formmail.pl http:/www.yourdomain.com/cgi-bin/trap.pl
Redirect 301 /home/virtual/site139/fst/var/www/cgi-bin/FormMail.pl http:/www.yourdomain.com/cgi-bin/trap.pl
Redirect 301 /home/virtual/site139/fst/var/www/cgi-bin/formmail.cgi http:/www.yourdomain.com/cgi-bin/trap.pl
Redirect 301 /home/virtual/site139/fst/var/www/cgi-bin/FormMail.cgi http:/www.yourdomain.com/cgi-bin/trap.pl
Redirect 404 /home/virtual/site139/fst/var/www/this_directory_does_not_exist http:/www.yourdomain.com/cgi-bin/trap.pl
Redirect 301 /home/virtual/site139/fst/var/www/cgi-bin/goodbye.pl http:/www.yourdomain.com/cgi-bin/trap.pl
It's pretty hard to remote debug a script installation, but a couple of points:
First, make sure that you have edited the PERL code to replace all instances of the pipe character "¦" with the one on your keyboard. The forum software interacts with browser character-set settings, and this character gets modified. It should appear in the code as a solid vertical line, otherwise PERL and mod_rewrite will choke on it.
Second, you cannot redirect to the script using Redirect 301. Using such an external redirect requires the user-agent (browser or robot) to cooperate and issue a request for the new URL. In the case of bad-bots, they will not do this.
Instead, use a server-internal redirect - actually just a path substitution - with mod_rewrite code like this:
RewriteRule formmail\.(pl¦cgi) http://www.yourdomain.com/cgi-bin/trap.pl [NC,L]
Again, edit that "¦" in the line above!
Note also that the [NC] flag makes the pattern compare case-insensitive, which eliminates the need for several of your posted redirects. More info: Introduction to mod_rewrite [webmasterworld.com]
HTH,
Jim