1<!DOCTYPE HTML>
2<html lang="en-US">
3 <head>
4 <meta charset="UTF-8">
5 <meta http-equiv="refresh" content="0; url=http://example.com">
6 <script type="text/javascript">
7 window.location.href = "http://example.com"
8 </script>
9 <title>Page Redirection</title>
10 </head>
11 <body>
12 <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
13 If you are not redirected automatically, follow this <a href='http://example.com'>link to example</a>.
14 </body>
15</html>
1<!DOCTYPE html>
2<html>
3 <head>
4 <title>HTML Meta Tag</title>
5 <meta http-equiv = "refresh" content = "2; url = https://www.tutorialspoint.com" />
6 </head>
7 <body>
8 <p>Hello HTML5!</p>
9 </body>
10</html>
1// similar behavior as an HTTP redirect
2window.location.replace("http://stackoverflow.com");
3
4// similar behavior as clicking on a link
5window.location.href = "http://stackoverflow.com";
6
7// Another method for doing redirecting with JavaScript is this:
8window.location = "https://stackoverflow.com";