views:

212

answers:

2

Is there anyway to use the value set in a SetEnv on the RewriteRule statement?

Example:

SetEnv MY_SCRIPT myScript.php

rewriteEngine on
RewriteRule ^(.*)$  %{MY_SCRIPT} [L]
A: 

Use %{ENV:MY_SCRIPT} instead of %{MY_SCRIPT}.

Gumbo
A: 

Thanks Gumbo.

I tried it but I got a "Directory index forbidden by Options directive:" error.

My feeling has been that I can't use the %{ENV:abc} on a RewriteRule

Not sure if that is true and I am just coding the RewriteRule incorrectly.

Dr. DOT
Don’t answer on your own question with a comment. If you want to comment on my answer, use the *add comment* link below my answer.
Gumbo