function hashRedir(frontpagePathname) {
  if (location.pathname != '/' || location.hash.length == 0) {
    var href = location.protocol + '//' + location.hostname

    if (location.pathname == '/') { href += '/#' + frontpagePathname; }
    else { href += '/#' + location.pathname; }

    location.href = href;
  }
}
