Hi
I got a mod_rewrite condition that relies on the output of a perl script, the perl script runs fine from command line, however when I try apache the condition is not matched.
Any help ?
Thanks
########.htaccess file
rewriteengine on
RewriteCond ${dash2score:%{REMOTE_ADDR}} yes
RewriteRule !^index.php$ http://www.howstuffworks.com [P,L]
#########apache2.conf
RewriteMap dash2score prg:/var/www/getIpStat.pl
#########getIpStat.pl
#!/usr/bin/perl
use DBI;
# Connect
my $dbh = DBI->connect('DBI:mysql:announcments:localhost','root', 'xxxxxxxx')
or die "Could not connect: $DBI::errstr\n";
# Get post_name
my $post_name = <STDIN>;
# my $post_name = $ARGV[$0];
chomp($post_name);
# Get data from db
my ($ID) = $dbh->selectrow_array("SELECT state FROM ips WHERE ip = ?", undef, $post_name);
# Display Results
print $ID;