【发布时间】:2015-01-15 12:32:23
【问题描述】:
我想知道是否有一种方法可以使用带有 if 语句的环境变量(或类似变量)来打开和关闭某些东西,例如 display_errors、modpagespeed。
例如:
SetEnv DISPLAY_ERRORS on
<If "DISPLAY_ERRORS == on">
php_flag display_errors on
</If>
<If "DISPLAY_ERRORS == off">
php_flag display_errors off
</If>
我花了很长时间寻找这样的东西,但我无法发现任何这样做的东西。这甚至可能吗?
我正在寻找一种使用 PHP 编辑 htaccess 的简单方法,但不是将块写入 htaccess,而是更改“on”和“off”值会更容易,也可以更轻松地显示这个作为我的应用程序中的单选按钮。
【问题讨论】:
-
找到解决方案了吗?
标签: apache .htaccess environment-variables