02-21-06 10:56 PM
manoj.agarwal.in@gmail.com wrote:
> a. Can I reset my HTTP_COOKIE value in the rewrite.conf file?
Some environmental variables (i.e. document_root) cannot be changed via
the E-Flag or mod_setenv(if).
The RewriteMap only returns a value which is being insert here in the
substitution. I don't think that you can manipulate ENVs from the prg
lookup script.
The manual states this:
| 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
Three options I can think of:
-> You're writing an other int function in mod_rewrite.c from where you
should have access to all apache internals
-> You can try to use the E-flag to set a ENV but as I said, i don't
think that you can override this variable here like
# escape literal periods
RewriteRule ^/(index\.html)?$ - [E=HTTP_COOKIE:${bcookie:$1}]
or if you can't place a map lookup within the E-flag (it's not
documented), I'd use something like
RewriteCond ${bcookie:$1} ^(.*)
RewriteRule ^/(index\.html)?$ - [E=HTTP_COOKIE:%1]
-> You're rewriting to some cgi-script which changes the variables and
then execute a program which returns some output like
exec /usr/bin/php ...somepath...
The difference here is you're in the last step of the processing
(content handler).
> Now I want to call this PERL script in my rewrite.conf (rewrite rule
> file) file in apache.
Make sure that the rules are being executed, i.e. if you're using
virtualhosts, you must place the rules there, or you use
| RewriteEngine on
| RewriteOptions inherit
in your <virtualhost> to include/execute the rules from the main server
config section.
In order to check if the rules are being processed, I'd use a RewriteLog.
--
Robert
[ Post a follow-up to this message ]
|