httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Othmar Pasteka <>
Subject [users@httpd] Problems calling scripts in RewriteMap
Date Wed, 17 Dec 2003 23:03:28 GMT

I have been now trying RewriteMap for all day long and didn't get
it working, maybe I am missing something obvious but I have read
the documentation several times now and I still don't know
anything more in how to get it working. My config:

RewriteEngine on
RewriteMap    session-check         prg:/var/www/
RewriteRule   (^.+$)       ${session-check:$1}
RewriteLog /var/log/apache/rewrite.log
RewriteLogLevel 9

All I want to do is that whenever some site is tried to be viewed
it should go trhough (or .php or .pl) should
check on the parameters if it's valid and well return two
different urls based on that.
In theory it shouldn't be a problem but for my apache
1.3.26-0woody3 (hence on debian woody) it doesn't work. whatever
I try it doesn't. I always get "400 Bad Request" sent back and I
have no clue why so :(.

The for scripts I tried and which all failed are (for which I
need the php one to get working so that's for me the most

#!/usr/bin/env python -u

import sys

for line in sys.stdin():

$| = 1;
while (<STDIN>) {
    # ...put here any transformations or lookups...
            print $_;

        $stdin = fopen('php://stdin', 'r');
        $stdout = fopen('php://stdout', 'w');
        $input_url = fgets($stdin, 3000);
	// also tried: fwrite($stdout,$input_url);

the logfiles usually look like the following. in the case of the
logfile snippet I had just " (/errorbh/index_corr.php) " as the pattern
in there but it wouldn't help much :(. - - [17/Dec/2003:23:59:17 +0100] [][r
id#81031f4/initial] (2) init rewrite engine with requested uri /errorbh/index_co
rr.php - - [17/Dec/2003:23:59:17 +0100] [][r
id#81031f4/initial] (3) applying pattern '(^.+$)' to uri '/errorbh/
p' - - [17/Dec/2003:23:59:17 +0100] [][r
id#81031f4/initial] (5) map lookup OK: map=session-check key=/errorbh/index_corr
.php -> val= - - [17/Dec/2003:23:59:17 +0100] [][r
id#81031f4/initial] (2) rewrite /errorbh/index_corr.php -> - - [17/Dec/2003:23:59:17 +0100] [][r
id#81031f4/initial] (2) local path result: 

So if someone does know where my problem is or how to get it
working, please don't hesitate to answer me! :)


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message