anchor.diff:      bind_vhost(Rest, RestHost, Bindings);
   bind_vhost(_, _, _) -> fail.
   
  +%% bind path
  +bind_path([], PathParts) ->
  +    {ok, PathParts};
  +bind_path(_VPathParts, []) ->
  +    fail;
  +bind_path([Path|VRest],[Path|Rest]) ->
  +   bind_path(VRest, Rest);
  +bind_path(_, _) ->
  +    fail.
  +
   % utilities
   
   
   %% create vhost list from ini
   make_vhosts() ->
       lists:foldl(fun({Vhost, Path}, Acc) ->
  -        {H, P} = split_host_port(Vhost),
  -        H1 = make_spec(H, []),
  -        [{{H1,P}, split_path(Path)}|Acc]
  +        [{parse_vhost(Vhost), split_path(Path)}|Acc]
       end, [], couch_config:get("vhosts")).
   
  +
  +parse_vhost(Vhost) ->
  +    case urlsplit_netloc(Vhost, []) of
  +        {[], Path} ->
  +            {make_spec("*", []), 80, Path};
  +        {HostPort, []} ->
  +            {H, P} = split_host_port(HostPort),
  +            H1 = make_spec(H, []),
  +            {H1, P, []};
  +        {HostPort, Path} ->
  +            {H, P} = split_host_port(HostPort),
  +            H1 = make_spec(H, []),
  +            {H1, P, string:tokens(Path, "/")}
  +    end.
  +            
   
   split_host_port(HostAsString) ->
       case string:rchr(HostAsString, $:) of
  
positive.code:         vhost_fun = Fun
      } = State,
  
  
      XHost = couch_config:get("httpd", "x_forwarded_host", "X-Forwarded-Host"),
      VHost = case MochiReq:get_header_value(XHost) of
  
negative.code: bind_port(Port, Port) -> ok;
  bind_port(_,_) -> fail.
  
  %% bind bhost
  bind_vhost([],[], Bindings) -> {ok, Bindings, []};
  bind_vhost([?MATCH_ALL], [], _Bindings) -> fail;
  bind_vhost([?MATCH_ALL], Rest, Bindings) -> {ok, Bindings, Rest};
  