You have a situation where you need to redirect one URL to another. Some would say, for what purpose? There can be a few reasons for this. One is you've changed your domain name and whenever someone accesses the old domain name, you want to redirect them to the new domain name. Another reason could be that a page on your website no longer exists, but you want to redirect people trying to access that page to a new page.
This tutorial focuses on:
- The window.location property
- Time delay redirects
The window.location property
The above example will redirect to landofcode.com home page
Time delay redirects
What if you want to give the user a message first and redirect them to another page only after a certain amount of time instead of doing it right away? You can do this using time delay redirects.
Click here to view the time delay script page which uses the above code