小编X10*_*X10的帖子

httpd.conf 变量:${var} 和 %{var} 有什么区别?

httpd.conf 中的${var}和 有什么区别%{var}

如何以及何时使用${}and %{}

http://httpd.apache.org/docs/2.4/configuring.html提到:

使用Define of 或shell 环境变量定义的变量值可以使用语法${VAR} 在配置文件行中使用。

http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html提到:

服务器变量:这些是 %{ NAME_OF_VARIABLE } 形式的变量

RewriteMap 扩展:这些是 ${mapname:key|default} 形式的扩展。

${VAR}在 httpd.conf 中的任何地方使用,除了 mod_rewrite 指令的(如 RewriteCond、RewriteRule 但除了${}RewriteRule中使用的 RewriteMap 扩展^/ex/(.*) ${examplemap:$1}

使用SetEnvIf指令在 httpd.conf 中设置的变量是否会在同一 httpd.conf 中使用,${var}除非该变量与 mod_rewrite 指令一起使用,该变量将用作%{var}

httpd.conf apache-2.2

7
推荐指数
1
解决办法
4457
查看次数

标签 统计

apache-2.2 ×1

httpd.conf ×1