• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Page Redirect with HTML

Hi Experts,

Can someone please remind me how to do a page redirect in HTML?  I believe it was under <head>.

Thank you.
0
APD Toronto
Asked:
APD Toronto
2 Solutions
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
I use something like:

<script language="javascript" type="text/javascript">
//<![CDATA[
  window.location = "http://www.filecats.co.uk/sitemap/";
//]]>
</script>

Open in new window

0
 
Joseph UndisNetwork and Systems AdministratorCommented:
I use the same kind of thing as Phillip has, however there's some additional text to make sure if the redirect fails for any reason it includes a link to the page.

<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1;url=http://google.com">
        <script type="text/javascript">
            window.location.href = "http://google.com"
        </script>
        <title>Page Redirection</title>
    </head>
    <body>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        If you are not redirected automatically, follow the <a href='http://google.com'>link here</a>.
    </body>
</html>

Open in new window

0
 
APD TorontoAuthor Commented:
Why not just  <meta http-equiv="refresh" content="1;url=http://google.com">
0
 
APD TorontoAuthor Commented:
Can anyone foresee any issues with only just that line.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
nothing wrong with the meta refresh tag, I've used it a lot in the past. Are you looking to do a permanent redirect? If so you may want to consider using a server side language so that you can add a status code (permanent recirect) to it, making it easier for spiders to index.

For more info - http://www.somacon.com/p145.php
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now