Fix HistoryLocation rootURL handling and webkit workaround
Merge pull request #2458 from teddyzeenny/history-location

Fixes to HistoryLocation