// if javascript is enabled and
// the URL does NOT contain #, add it
if (window.location.hash == '')
{
    base = (base == '/') ? '' : base;
    location.replace(base + '/#' + window.location.pathname.replace(base, '')+location.search);
}