I am searching to perform a general alias for this site for an application home directory, but you will find some files and sites that has to be vhost specific, for example caches and client-provided files. I'm able to easily do that to offer the application alias:

AliasMatch ^(.*)$ "/path/to/app$1"

However I would now like to exclude certain files/folders. At this time, I've got a couple of lines such as this prior to the AliasMatch:

Alias /favicon.ico "/var/www/html/vhosts/domain.name/httpdocs/favicon.ico"

However , that simply causes it to be do what it really might have done with no AliasMatch, inside a much simpler to typo and hard to reuse way. So it is possible to method to simply exclude /favicon.ico, or at best utilize DocumentRoot like a constant, and so i could make a move such as this rather?

Alias /favicon.ico "$DocumentRoot$/favicon.ico"

you should use syntax such as this for AliasMatch -


AliasMatch ^(/(f(?!avico.ico)[^f]).*)$ "/path/to/application$1"

This can not match /favico.ico, so it will likely be looked in DocumentRoot of vhost