How to test if file exists with the tag <If …> on Apache 2.4?

十年热恋 提交于 2019-11-29 07:39:54

问题


I would like to test the existence of a file in my httpd.conf of Apache 2.4.

I use the tag like this :

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

but my code is not good, apache's service doesn't want to start. I have read a lot of tutorials or docs on many sites but never found the answer :(

Please help me ...


回答1:


You should read Apache error log as it might provide some hint on how it is interpreted.

Anyway, the right syntax is: <If "-f %{DOCUMENT_ROOT} . '/maintenance.enable'">



来源:https://stackoverflow.com/questions/26138120/how-to-test-if-file-exists-with-the-tag-if-on-apache-2-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!