.htaccess Environment Variables
Posted: Mon Jan 22, 2007 10:59 am
Hoping someone can help me with this problem. I'm trying to pass a variable with a RewriteRule in my .htaccess file using this technique:
RewriteRule foo bar [E=VAR:VAL]
I refer to the variable on the resulting page using:
<? php
echo $_SERVER["VAR"];
?>
and get no results. I've used phpinfo() and find that the variable doesn't show up.
I have also tried this:
<? php
echo $_SERVER["REDIRECT_VAR"];
?>
with no luck.
This, however, does return a value:
echo $_SERVER["REDIRECT_URL"];
but this wasn't the solution I was looking for.
I'm using a hosting site w/ Apache/1.3.37 and PHP Version 4.4.4
Any ideas?
--
Michael
RewriteRule foo bar [E=VAR:VAL]
I refer to the variable on the resulting page using:
<? php
echo $_SERVER["VAR"];
?>
and get no results. I've used phpinfo() and find that the variable doesn't show up.
I have also tried this:
<? php
echo $_SERVER["REDIRECT_VAR"];
?>
with no luck.
This, however, does return a value:
echo $_SERVER["REDIRECT_URL"];
but this wasn't the solution I was looking for.
I'm using a hosting site w/ Apache/1.3.37 and PHP Version 4.4.4
Any ideas?
--
Michael