Solved

Page Redirect with HTML

Posted on 2014-09-26
5
165 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Getting selected value of a dropdown with jquery 7 34
simple javascript form validation 2 18
Javascript Form Change 5 17
alert(innerHTML); 8 12
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

776 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