I have an app in a domain like this http://www.example.com/, but I need to replace the state to a subdomain, like this http://test.example.com/.
I’m trying to do this with replaceState like this:
history.replaceState({}, '', 'http://test.example.com/')
But in Firebug I’m getting an error:
Error: Security error
I understand this maybe is breaking Same Origin Policy. Is there a way to set the subdomain without reloading the page?
No. You can’t change the origin of the page without reloading it, precisely because it would violate the same-origin policy.