Apache mod_rewrite: RewriteMap directive using PHP script on Windows machine

I doubt the magic cookie trick, also known as the shebang, would work on Windows. This is a UNIX/Linux feature.

You'll have to specify the PHP interpreter and the script as its argument (see also http://www.webmasterworld.com/forum92/859.htm):

RewriteMap router "prg:C:/Program Files/PHP5.3.2/php-win.exe C:/dev/web/www/routing.php"

If that doesn't work, it might be because of the space in Program Files. Windows supports a short name in such cases. For example PROGRA~1 is a typical short name, but the digit in the name is assigned on a first-come first served basis, so you should double-check with the DIR command.

Or else you could move your php-win.exe executable to a directory that doesn't contain spaces.

If it isn't totally clear already, I'll say this: Windows sucks.