TransWikia.com

Is there a method to check the given document root directory exists in Apache2 virtual host?

Server Fault Asked by AH. on November 24, 2021

I want to check the root directory exists or not in Apache2 virtual host. If it doesn’t exist I want to point the virtual host to a default directory. Is it possible?

One Answer

It should work can you try?

<If "-d /var/www/html">
  DocumentRoot "/var/www/html"
</If>
<Else>
  DocumentRoot "/var/www/html2"
</Else>

Answered by Burak Talha Bolat on November 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP