Gossamer Forum
Home : General : Internet Technologies :

Passing Environment Variable from htaccess to SSI

Quote Reply
Passing Environment Variable from htaccess to SSI
Don't know if this is the right forum, but seem to have seen one on a similar subject here and needed help.

I have the following code in my htaccess file

*********************
DirectoryIndex cgi-bin/y/d.cgi/?index-IPP10000 index.htm
RewriteEngine on
Options +FollowSymlinks -Indexes
RewriteBase /
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.com/.*$ [NC]
RewriteRule \.(gif|jpe?g|png|bmp)$ - [F,NC,L]
RewriteRule ^\.htaccess$ - [F]
RewriteRule ^([0-9]+)/([A-Za-z]+)$ cgi-bin/y/d.cgi/?$2-IPP$1 [L,E=MY_VAR:$1]
RewriteRule ^([0-9]+)$ cgi-bin/y/d.cgi/?index-IPP$1 [L,E=MY_VAR:$1]
ReWriteRule ^([A-Za-z])$ $1.shtml [L,E=MY_VAR:$1]
*********************
and the following in a test page named test.shtml
*********************
<html>
<head>
<title>No title</title>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p><!--#echo var="MY_VAR" --></p>
<p><!--#echo var="DOCUMENT_NAME" --></p>
</body>
</html>
*********************
When I open the page, the DOCUMENT_NAME variable is replaced with"test.shtml," and the MY_VAR variable is replaced with "(none)."
Can anyone tell me why the SetVar flag "E=MY_VAR:$1" is not working? Why the variable $1 is not being passed?
Any help would be appreciated.
Thanks,
Calvin