   search = location.search?.replace(/\%2[fF]/g, '/')
   loc = location.pathname?.replace(/\%20/g, ' ')
 
-  if Earl.root && !!loc.match(Earl.root)
-    loc = loc.split(Earl.root)[1]
+  if Earl.root
+    loc = (loc + '/').split(Earl.root)[1]
 
   "#{loc}#{search}#{location.hash}"
 
 url_from_statebus = ->
   loc = fetch 'location'
 
-  relative_url = loc.url or '' 
+  relative_url = loc.url or '/'
 
   if loc.query_params && Object.keys(loc.query_params).length > 0
     query_params = ("#{k}=#{v}" for own k,v of loc.query_params)

      # after it is processed. 
      seek_to_hash = true

    loc.url = url
    loc.hash = hash

    save loc


      # update browser history if it hasn't already been updated
      if url_from_browser_location() != new_location
        h = (Earl.root + new_location)
        history.pushState loc.query_params, title, h.replace(/(\/){2,}/, '/').replace(/(\/)$/, '')

      @last_location = new_location

