Configuring a local development linux box I'd like to have some sneaky Apache2 configuration which would do the following, when I request 'sub.domain.tld.local':
1.) Serve from: vhost/domain.tld/sub/htdocs/ 2.) If there's no such directory, serve from: vhost/sub.domain.tld/htdocs/ 3.) If there's no such directory, serve from: vhost/domain.tld/htdocs/
'.local' is just a static "suffix" which should not match any directory.
My current configuration looks like this:
<VirtualHost *:80> ServerAlias *.local UseCanonicalName Off VirtualDocumentRoot "/vagrant/host/%-2+/htdocs/" VirtualScriptAlias "/vagrant/host/%-2+/htdocs/" </VirtualHost>
This works well for 2) or 3) but not in the manner of "crawling" the directory structure and falling back from 1) to 2) to 3). Preferably I'd like to only use the VirtualDocumentRoot directive somehow without any rewrite rules.
If it won't work without rewrites, I'm of course okay with that too.
Any idea how to solve that?