1

Apache2 VirtualDocumentRoot wildcard subdomains with fallback

view story
linux-howto

http://serverfault.com – 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/" (HowTos)