PB program to handle Mod_Rewrite (rewriting URLs)
Posted: Thu Jan 22, 2009 3:49 pm
Has anyone done this?
I'm just beginning with Mod_Rewrite but Xampp is playing up so I can't do any testing (yet), so in the meantime I'd like to know if anyone else has succeeded in doing this.
You can read about it here. It's an article about implementing mod_rewriting in your site's htaccess file. Normally this is done with the RewriteCond and RewriteRule functions, but you can also pass the duty to an external program, including executables apparently...
There are a few things I need to know...
Seymour.
I'm just beginning with Mod_Rewrite but Xampp is playing up so I can't do any testing (yet), so in the meantime I'd like to know if anyone else has succeeded in doing this.
You can read about it here. It's an article about implementing mod_rewriting in your site's htaccess file. Normally this is done with the RewriteCond and RewriteRule functions, but you can also pass the duty to an external program, including executables apparently...
That sounds like the operation of a CGI executable except there's only one input variable and the program has to loop constantly, checking if the input variable has changed.External Rewriting Program
MapType: prg, MapSource: Unix filesystem path to valid regular file
Here the source is a program, not a map file. To create it you can use the language of your choice, but the result has to be a executable (i.e., either object-code or a script with the magic cookie trick '#!/path/to/interpreter' as the first line).
This program is started once at startup of the Apache servers and then communicates with the rewriting engine over its stdin and stdout file-handles. For each map-function lookup it will receive the key to lookup as a newline-terminated string on stdin. It then has to give back the looked-up value as a newline-terminated string on stdout...
There are a few things I need to know...
- Do PB programs qualify as "object-code executables"? According to this definition, it would seem they do.
- Would the executable have to be compiled for Linux even if the server was Windows-based? (Silly question perhaps but I'm asking because the above article specifies "Unix filesystem path".)
- How do you get a stdin variable? I know how to get CGI variables using GetEnvironmentVariable("VARIABLE_NAME") but this seems a little different. There doesn't seem to be a "forum consensus" on how to do this. ReadConsoleData()?
- How to detect if the input variable has changed?!
Seymour.