Fix dependency loop in vhost

Also fix missing backslash from test for rewrites.