       matched = item
       true
   matched
+
+joinURLs = (before, after)->
+  if before[before.length-1] == '/' and after[0] == '/'
+    before + after.substring(1)
+  else if before[before.length-1] == '/' || after[0] == '/'
+    before + after
+  else
+    before + '/' + after
 
 module.exports.loadFile = (configPath)->
 

            if @target.nopath
              targetPathBase
            else if @target.nostrippath
              path.join targetPathBase, reqUrl
            else
              path.join targetPathBase, reqUrl.substring(@_path.length)

      match


              if @target.nopath
                @target.pathname
              else if @target.nostrippath
                joinURLs targetPathBase, reqUrl
              else
                joinURLs targetPathBase, reqUrl.substring(@_path.length)
      else
        match =
          target: host.default
