Answers for "if i want to redirect to other page other than home, return redirect('/')"

48

How do I redirect to another webpage?

// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");

// similar behavior as clicking on a link
window.location.href = "http://stackoverflow.com";
Posted by: Guest on May-14-2020
0

Which of the following is the correct way to redirect a user to a new page?

window.location = "http://new-website.com";
window.location.href = "http://new-website.com";
window.location.assign("http://new-website.com");
window.location.replace("http://new-website.com");
Posted by: Guest on October-09-2020

Code answers related to "if i want to redirect to other page other than home, return redirect('/')"

Code answers related to "Javascript"

Browse Popular Code Answers by Language