I’m looking to do a general alias for my website to an application home directory, but there are some files and directories that must still be vhost specific, such as caches and client-supplied files.
I can easily do this to achieve the application alias:
AliasMatch ^(.*)$ "/path/to/app$1"
But I now want to exclude certain files/folders. Right now, I have a bunch of lines like this before the AliasMatch:
Alias /favicon.ico "/var/www/html/vhosts/domain.name/httpdocs/favicon.ico"
But really that just makes it do what it would have done without the AliasMatch, in a much easier to typo and difficult to reuse way. So is there a way to simply exclude /favicon.ico, or at least utilize DocumentRoot as a constant, so I could do something like this instead?
Alias /favicon.ico "$DocumentRoot$/favicon.ico"
you can use syntax like this for AliasMatch –
This will not match /favico.ico, so it will be looked in DocumentRoot of vhost