1

Is it possible using SetEnvIf to set a variable to the content of another variable? and if so, how?

For example

SetEnvIf defined_htaccess_var ^(.*)$ has_been_defined=%{defined_htaccess_var}

So the idea is, if inside the apache.conf or httpd conf defined_htaccess_var has been defined, then has_been_defined inside the .htaccess should now contain the value of it?

Note. This is for apache 2.2

owenmelbz
  • 163
  • 3
  • 12

1 Answers1

0

The syntax is SetEnvIf attribute regex [!]env-variable[=value] source : https://httpd.apache.org/docs/2.2/mod/mod_setenvif.html

for example:

store URI in has_been_defined
SetEnvIf Request_URI (.*) has_been_defined

After it depend of what you want to store

by the way .* in regexp mean all, so ^ (start with) & $ (end with) is not needed

Froggiz
  • 3,043
  • 1
  • 19
  • 30
  • I want the store the variable thats defined in the example and question, need to check if a variable exists, and assign the value of that variable to another if it does. – owenmelbz Nov 23 '15 at 17:10