如何测试文件是否与标签一起存在 在Apache 2.4上?

问题描述 投票:11回答:1

我想在Apache 2.4的httpd.conf中测试一个文件的存在。

我使用这样的标签:

<If "%{DocumentRoot}/maintenance.enable -f"> ...code to execute ... </If>

但我的代码不好,apache的服务不想启动。我在很多网站上阅读了很多教程或文档,但从未找到答案:(

请帮我 ...

apache if-statement httpd.conf
1个回答
16
投票

您应该阅读Apache错误日志,因为它可能会提供有关如何解释它的一些提示。

无论如何,正确的语法是:<If "-f %{DOCUMENT_ROOT} . '/maintenance.enable'">

© www.soinside.com 2019 - 2024. All rights reserved.