首页 文章

如何检查.htaccess中是否未定义变量?

提问于
浏览
0

我知道我可以在 httpd.conf 中设置一个自定义变量,以便在 .htaccess 中访问 . 我想让我的代码变得简单,所以当新程序员在新机器中设置它时,它不会轻易得到错误 .

如何检查 .htaccess 内部的未定义变量,以便在有人忘记在 httpd.conf 中设置变量时仍然可以运行?

RewriteBase /

RewriteCond ${ServerBase} !^$
RewriteBase ${ServerBase}

我以为 !^$ 可以检测到未定义的变量,但是没有 .

1 回答

相关问题