I've currently got a vhost record that sets an ENV variable which is used by the webapp. However there is a possibility of a second instance of the same webapp in a subdirectory. If this is the case, I need the ENV variable to be set for this secondary webapp instead of the default one.
For example:
- Code: Select all
<VirtualHost *:80>
ServerName foo.com
Alias /bar /var/www/bar
DocumentRoot /var/www/foo
ErrorLog /var/log/httpd/foo-error_log
CustomLog /var/log/httpd/foo-access_log combined
DirectoryIndex index.html index.htm index.php index.php4 index.php5
Options +FollowSymlinks -Indexes +ExecCGI
SetEnv CONF foo
</VirtualHost>
So, if the URL entered is just 'foo.com' the CONF variable will be set to 'foo'. However if the URL is 'foo.com/bar', I'd like the CONF variable to be reset to 'bar'.
How can I do this?
Alternately, perhaps a more robust way would be to have two vhost directives. (one for foo.com one for bar.com) and then someone alias foo.com/bar to bar.com (so from the end users perspective they are at foo.com/bar but apache is actually using the settings defined in the vhost entry for bar.com. This is basically like using an HTML iframe, but cleaner, and in the apacheconf. Is there a way to do this?
Thanks,
Nick