To redirect a web page’s visitors to another page on the same domain:
window.location.pathname = "/new-page"
To redirect a web page’s visitors to a page on a different domain:
window.location.href = "https://www.example.com/page"
That’s all there is to it!
Love our articles? HostM offers professional and helpful web hosting services with unlimited features and renewal rates that actually match our advertised rates.
|Click here to get started.|
It’s fast, easy and secure.
|Sign Up Now|