Redirecting with JavaScript

Sometimes you want to redirect visitors to a different page, but don’t have access to the server-side language on the server where your page resides. Here’s how to redirect with JavaScript:

<script type="text/javascript">
    window.location = "http://example.com/redirect/";
</script>

That will redirect any visitors to the page specified, if they have JavaScript enabled. I also leave a note for those that have no JavaScript capabilities or in case something goes wrong:

This page is now at
<a href="http://example.com/url-you-want-to-redirect-to/">
    http://example.com/url-you-want-to-redirect-to/
</a>, thanks!

Here is how you can redirect using PHP, if you access to it: Redirect with PHP.