add support for explicit subdomains

this way, if you link something as `foo.example`, it will be reachable from `foo.example.dev`, or more generally `$prefix.foo.example.dev`.

This is needed at my work since we have several apps that need to run on the same domain, so it's easier to set up all the apps as `app-name.company-domain.dev`

This should be a backwards-compatible change, since arbitrary subdomains still work in the case that was supported before.