我知道我可以在 httpd.conf
中设置一个自定义变量,以便在 .htaccess
中访问 . 我想让我的代码变得简单,所以当新程序员在新机器中设置它时,它不会轻易得到错误 .
如何检查 .htaccess
内部的未定义变量,以便在有人忘记在 httpd.conf
中设置变量时仍然可以运行?
RewriteBase /
RewriteCond ${ServerBase} !^$
RewriteBase ${ServerBase}
我以为 !^$
可以检测到未定义的变量,但是没有 .
1 回答
在你想要的东西:
转到指令定义,文档在这里:https://httpd.apache.org/docs/2.4/mod/core.html