Add a hash if one isn't already present
Preserve location hash in referer