window.location.href = "https://stackoverflow.com/questions/8824141/URL2"
inside a JS block on the page or in an included file; that’s assuming you really want to do it on the client. Usually, the server sends the redirect via a 300-series response.