Use RewriteCond based on environment variable in .htaccess

后端 未结 3 1457
北荒
北荒 2021-02-02 17:59

I am trying to define an environment variable in my .htaccess file, and then run a rewrite condition using that variable. Below is what I have in my .htaccess file, but the rew

3条回答
  •  青春惊慌失措
    2021-02-02 18:40

    Bit late - but for all the others searching ...

    use SetEnvIf - see: mod_rewrite rule and setenv

    SetEnvIf Request_URI ".*" ENVIRONMENT=maintenance

    ...

提交回复
热议问题