Solved

Page Redirect with HTML

Posted on 2014-09-26
5
158 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
Comment Utility
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
Comment Utility
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
Comment Utility
Why not just  <meta http-equiv="refresh" content="1;url=http://google.com">
0
 

Author Comment

by:APD_Toronto
Comment Utility
Can anyone foresee any issues with only just that line.
0
 
LVL 32

Assisted Solution

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now