Virtual Hosts - if statment... help.
Posted: 22. January 2009 10:52
Here are 2 of my virtual hosts in my 'httpd-vhosts.conf' file (they have their '127.0.0.1 localhost' in the windows hosts file).
The problem is that the 'E drive' (E:\) is not always available, so when it's not there Xampp doesn't run.
Is there a way to add an if statement which checks to see if the 'E drive' is available before adding that virtual host? Or some other method besides deleting the offending virtual host?
- Code: Select all
## ----------------------------------------------------------------------------
## Client: localhost
## ----------------------------------------------------------------------------
<VirtualHost *:80>
DocumentRoot "C:/mysite"
ServerName localhost
<Directory "C:/mysite">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
- Code: Select all
## ----------------------------------------------------------------------------
## Client: localhost2
## ----------------------------------------------------------------------------
<VirtualHost *:80>
DocumentRoot "E:/myweb"
ServerName localhost
<Directory "E:/myweb">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
The problem is that the 'E drive' (E:\) is not always available, so when it's not there Xampp doesn't run.
Is there a way to add an if statement which checks to see if the 'E drive' is available before adding that virtual host? Or some other method besides deleting the offending virtual host?