Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to check if a directory exists in Apache configuration files?

Is there a way to include configuration settings in Apache based on if a directory exists? Basically I have a portable hard drive that I transport between work and home that has some stuff I'm developing on it. I only want the Apache config to load a particular virtual host if the folder exists.

like image 651
Robert Avatar asked Sep 12 '10 21:09

Robert


1 Answers

Since Apache 2.4.34 you can now use <IfFile>...</IfFile> which will check to see if a file exists. There's more details on the <IfFile> page.

like image 141
Matthew Buckett Avatar answered Oct 23 '22 09:10

Matthew Buckett