I need to create a rewrite map in php and this is totally uncharted territory for me and lengthy searches online have not provided the info that I need so far. I hope that this is the right topic to post under. If you need to understand my reasons for needing a rewrite map you can follow my thread on the mod_rewrite forum here: http://forum.modrewrite.com/viewtopic.php?t=32261&start=0 I understand that when my php scipt is called by httpd.conf the requested url will be passed to the script in STDIN and that my modified url must be output on STDOUT. I can write standard php code to perform the manipulations required to the url no problem. Apparently for a rewrite map the php must run from the command line and I have no idea if this affects the way the code should be written or limits in any way the functions that I can use. I certainly need to use sessions and ideally would like to use a cross domain include if that is possible. What I need help with is creating the rewrite map page. How do I start the file and assign STDIN to a variable that I can manipulate and how do I finish the file so that the modified url is passed to STDOUT? This is what I have come up with so far but I really have no idea if it is correct or not. If anyone is able to assist I would be most grateful.