Fixed rewriteHrefs bug with pathname '/'