Problem with RewriteMap

Oh, the strange things mod_rewrite does!

Problem with RewriteMap

Postby Houseangel » Wed Oct 13, 2004 11:30 am

I got a strange problem with mod_rewrite. I am trying to use a RewriteMap statement, that looks like this:

Code: Select all
RewriteMap robots prg:d:/webserver/apache/bin/modrw.pl


The Perl Script looks like that:

Code: Select all
#!d:\webserver\perl\bin\perl.exe

$| = 1;

my %robots;

open(ROBOTS,"<d:\\webserver\\apache\\bin\\robots.txt");

while(<ROBOTS>)
{
   #chomp($_);
   #$robots{$_} = "robot";
   #print $_."=".$robots{$_}."\n";
}

close(ROBOTS);

while(<STDIN>)
{
   chomp($_);

   #if(exists $robots{$_})
   #{
   #   print $robots{$_}."\n";
   #}
   #else
   #{
      #print "NULL\n";
   #}
   
   print "robot\n";
}


The server starts and no problems occur up to the moment I do a request. It is not redirected (as I wanted it to) but the requested page is displayed. In the rewrite.log i can find the following entry:

Code: Select all
127.0.0.1 - - [13/Oct/2004:21:17:14 +0200] [xxx/sid#5b5800][rid#cc3440/initial] (5) map lookup FAILED: map=robots key=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)


Can anybody tell me why my (really, really simple) Map does not work? Is it cause i am using Windows?

Thank you
Angel
Houseangel
 
Posts: 2
Joined: Wed Oct 13, 2004 1:55 am

Postby Guest » Fri Oct 22, 2004 6:27 am

I have no idea. Have you tried a more simple CGI prog to see if it works in concept.

This may help (sure you have been there before)
http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#mapfunc
Guest
 

Postby seomike » Tue Oct 26, 2004 9:16 am

are you trying to redirect search engine robots around?
seomike
 
Posts: 331
Joined: Thu May 06, 2004 7:36 pm
Location: Dallas

Postby Caterham » Sat Dec 11, 2004 2:50 pm

Apache manual wrote:MapSource: Unix filesystem path to valid regular file
it really seems to be that rewrite_maps are limited to Unix file systems only :frown:
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 3 guests

cron