Solved

Page Redirect with HTML

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show banners that are blocked by Ad Muncher 10 48
Form Processing in PHP 11 32
compact pure CSS Read More Toggle 4 24
wordpress display sub menu only when click 12 23
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Find out what you should include to make the best professional email signature for your organization.
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

896 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

18 Experts available now in Live!

Get 1:1 Help Now