Replace all anchor hrefs using js location.host to preserve port