Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用 SetEnvIf 将变量设置为另一个变量的内容?如果是这样,如何?
例如
SetEnvIf defined_http_conf_var ^(.*)$ has_been_defined=%{defined_http_conf_var}
所以想法是,如果apache.conf或httpd conf里面defined_htaccess_var已经定义了,那么has_been_defined.htaccess里面现在应该包含它的值吗?
defined_htaccess_var
has_been_defined
笔记。这是针对 apache 2.2
你可以像这样使用它:
# unconditionally sets defined_htaccess_var=some_value SetEnvIf Host ^ defined_htaccess_var=some_value # sets another var has_been_defined=<value of defined_htaccess_var> SetEnvIf defined_htaccess_var .+ has_been_defined=$0
在此处查看更多详细信息