httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Kroll <>
Subject [users@httpd] RewriteMap prg: How to pass value from Python3 script back to Apache24?
Date Sat, 10 Nov 2018 19:33:07 GMT

using Rewrite Map with MapType prg in Apache 2.4, I'm having trouble 
passing the value back to Apache.

The log says "map lookup OK", but the value is empty.

On Stackoverflow and others, I found and tried out some examples, which 
in some cases where quite old, so probably written for older versions.

The following is what I extracted from the more current hints I could find.

         RewriteEngine On
         RewriteMap extrw "prg:/opt/"
         RewriteRule "^(.*)" "${extrw:%{REQUEST_URI}}"

	import sys
	while True:
	    newValue = "/index.html"  # placeholder for testing
	    sys.stdout.write(newValue + "/n")

log for curl
	init rewrite engine with requested uri /abc
	applying pattern '^(.*)' to uri '/abc'
	map lookup OK: map=extrw key=/abc -> val=
	rewrite '/abc' -> ''
	local path result:

The expected result would be to have "map lookup OK: map=extrw key=/abc 
-> val=/index.html" in the third line.

Any help would be appreciated!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message