In situations where path() matched basepath and we needed to convert from html5 url to hashbang url, the $location service considered the url to be already rewritten, which resulted in an error.