my httpd.conf script is :
RewriteEngine on
RewriteLogLevel 3
RewriteLog "/rewrite.log"
RewriteMap chmap prg:/check.pl
RewriteRule /sites.examples/(.*) ${chmap:$1} [NS,P]
and my perl file script is:
#!/usr/bin/perl
$¦=1;
# PERL MODULES
use Mysql;
# MYSQL CONFIG VARIABLES
$host = "localhost";
$database = "test";
$tablename = "rewrite";
$user = "#*$!xx";
$pw = "#*$!#*$!x";
# PERL CONNECT()
$connect = Mysql->connect($host, $database, $user, $pw);
# SELECT DB
$connect->selectdb($database);
#print 'http://192.168.1.24/website/sites/0162/examples@examples.com/s_31324654646464/index.html';
while (my $in = <STDIN>){
# $_ -- This holds the requested url to rewrite
chomp($in);
my $myquery = 0;
my $execute = 0;
my $array = 0;
# DEFINE A MySQL QUERY
$myquery = "SELECT * FROM rewrite WHERE short = \"$in\"";
# EXECUTE THE QUERY FUNCTION
$execute = $connect->query($myquery);
@array = $execute->fetchrow;
print 'http://192.168.1.24/'.$array[1];
}
##EOF##
when i try to hit URL
[192.168.1.24...]
it never returns anything and keep trying to load
in log file i found this
192.168.1.10 - - [25/Jun/2008:22:08:12 +0500] [192.168.1.24/sid#877f398][rid#8b2bfc0/initial] (2) init rewrite engine with requested uri /sites.examples/helloworld
192.168.1.10 - - [25/Jun/2008:22:08:12 +0500] [192.168.1.24/sid#877f398][rid#8b2bfc0/initial] (3) applying pattern '/sites.examples/(.*)' to uri '/sites.examples/helloworld'
browser keep trying to load but nothing came up
on the other hand when i run this perl script on shell it runs well takes input and print the path and then listen for another input
could anyone please help me in this regard
Thanks