       # after it is processed. 
       seek_to_hash = true
 
-    loc.url = url
+    loc.url = url or '/'
     loc.hash = hash
 
     save loc


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

      @last_location = new_location


  search = location.search?.replace(/\%2[fF]/g, '/')
  loc = location.pathname?.replace(/\%20/g, ' ')

  if Earl.root
    loc = (loc + '/').split(Earl.root)[1]

  "#{loc}#{search}#{location.hash}"

url_from_statebus = ->
  loc = fetch 'location'

  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)
