Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Page Redirect with HTML

Posted on 2014-09-26
5
168 Views
Last Modified: 2014-09-26
Hi Experts,

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

Thank you.
0
Comment
Question by:APD_Toronto
5 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40346215
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
 
LVL 6

Accepted Solution

by:
Joseph Undis earned 250 total points
ID: 40346218
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
 

Author Comment

by:APD_Toronto
ID: 40346243
Why not just  <meta http-equiv="refresh" content="1;url=http://google.com">
0
 

Author Comment

by:APD_Toronto
ID: 40346303
Can anyone foresee any issues with only just that line.
0
 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 40346322
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
edit .asp files 5 31
Javascript the "if condition with Or" 8 29
html input 8 42
Html Newline 7 20
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question