anchor.diff:                      end, [], Bindings1),
   
                       FinalBindings = Bindings2 ++ QueryArgs1,
  -                    NewPathParts = make_new_path(RedirectPath, FinalBindings, 
  -                                    Remaining, []),                                    
  -                    {NewPathParts, FinalBindings};         
  +                    NewPathParts = make_new_path(RedirectPath, FinalBindings,
  +                                    Remaining, []),
  +                    {NewPathParts, FinalBindings};
                   fail ->
                       try_bind_path(Rest, Method, PathParts, QueryList)
  -            end;    
  +            end;
           false ->
               try_bind_path(Rest, Method, PathParts, QueryList)
       end.
  -    
  -%% rewriting dynamically the quey list given as query member in 
  +
  +%% rewriting dynamically the quey list given as query member in
   %% rewrites. Each value is replaced by one binding or an argument
   %% passed in url.
   make_query_list([], _Bindings, Acc) ->
  
positive.code:             parse_path(From)
          end,
      ToParts  = case proplists:get_value(<<"to">>, Rule) of
          undefined ->  
              throw({error, invalid_rewrite_target});
          To ->
              parse_path(To)
          end,
      [{FromParts, Method}, ToParts, QueryArgs].
      
  parse_path(Path) ->
      {ok, SlashRE} = re:compile(<<"\\/">>),
      path_to_list(re:split(Path, SlashRE), []).
      
  %% @doc convert a path rule (from or to) to an erlang list
  %% * and path variable starting by ":" are converted
  %% in erlang atom.
  
negative.code: -define(MATCH_ALL, '*').
  
  
  %% doc The http rewrite handler. All rewriting is done from
  %% /dbname/_design/ddocname/_rewrite by default.
  %%
  %% each rules should be in rewrites member of the design doc.
  %% Ex of a complete rule :
  %%
  %%  {
  %%      ....
  %%      "rewrites": [
  %%      {
  %%          "from": "",
  %%          "to": "index.html",
  %%          "method": "GET",
  %%          "query": {}
  %%      }
  %%      ]
  %%  }
  %%
  %%  from: is the path rule used to bind current uri to the rule. It
  %% use pattern matching for that.
  %%
  %%  to: rule to rewrite an url. It can contain variables depending on binding
  