Here’s one of the simplest ways to send your page’s visitors to a new URL.
Redirect to a different URL
Copy the code below and paste it into the <head> of a blank HTML page.
<script>
window.location.replace("https://YOUR-REDIRECT-PAGE");
</script>
window.location.replace() doesn’t keep the redirecting page in the browser history, so the Back button won’t bounce visitors into the redirect again. To also redirect visitors who have JavaScript turned off, add a meta refresh tag to the <head> as a fallback:
<meta http-equiv="refresh" content="0; url=https://YOUR-REDIRECT-PAGE">
*Replace YOUR-REDIRECT-PAGE with your new URL.
Note: If a page has moved permanently and you control the server, a server-side 301 redirect (for example in .htaccess) is better for SEO than a JavaScript or meta refresh redirect.
