A redirect is when a web page is visited at a certain URL, it changes to a different URL. For example, a person visits “website.com/page-1” in their browser and they are redirected to “website.com/page-2” instead.
This is very useful if we want to shut old website and redirect all the traffic to new website. What we need is for those old links to redirect to the same content on our new site.
window.location = "http://new-website-name.com";
There are some others ways also to redirect
window.location = "http://new-website-name.com"; window.location.href = "http://new-website-name.com"; window.location.assign("http://new-website-name.com"); window.location.replace("http://new-website-name.com");