How to Redirect in HTML (Page or URL)
If you need to redirect your visitors to a new page, this HTML redirect code may be just what you’re looking for. I will show you how to redirect in HTML.
When designing a web site, many times you must change the location of a web page. However, if the page is popular, your visitors may have already linked to it. In addition, the Search Engines have most-likely already indexed the page.
For this reason, it is best to replace your page with a new page that will redirect your visitors to the new page. This provides a great way to provide your visitors with the information they were looking for and prevent you from losing your traffic.
Place the following HTML redirect code between the <head>
and </head>
tags of your HTML code.
<meta http-equiv="refresh" content="0;url=http://example.com">
You can do the same thing using javascript.
<script type="text/javascript"> window.location.href = "http://example.com" </script>