htaccess If…Else always selects Else

前端 未结 4 1799
温柔的废话
温柔的废话 2021-02-12 21:59

I set an environment variable in httpd-vhosts.conf

SetEnv EARLY_VAR 1

I try setting special rules based on its value in

4条回答
  •  无人及你
    2021-02-12 22:41

    If you found problem with SetEnv and SetEnvIf in your Apache configuration.

    Set the variable in httpd.conf file as below

    SetEnvIf Host ".*" EARLY_VAR=1
    SetEnvIf Host eval EARLY_VAR=1
    SetEnvIf Host dev EARLY_VAR=1
    

    It assign the value in all type of server (production ,evaluation or development)

    Now you can use your variable in .htaccess file.

    
        SetEnv TEST_VAR if_value
    
    
        SetEnv TEST_VAR else_value
    
    

提交回复
热议问题