本文介绍了使用 Apache .htaccess 设置 PHP $_SERVER 值 ($_SERVER['something'])的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 .htaccess 或其他 apache 权限在 php 数组 $_SERVER 中设置自定义服务器值.

Is it possible using .htaccess or other apache powers to set a custom server value in the php array $_SERVER.

例如

if($_SERVER['is_special']) {
    echo "Yeah for us!";
} else {
    echo "No you fool!";
}

我知道我问了很多问题,答案是否定的,所以请随意说出来.

I realize I ask a lot of questions that the answer is no so feel free to say so.

推荐答案

试试 SetEnv 指令:

Try the SetEnv directive:

SetEnv is_special foobar

这篇关于使用 Apache .htaccess 设置 PHP $_SERVER 值 ($_SERVER['something'])的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 16:48