Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

How to redirect to another URL

I've seen web sites that show a page for a few seconds, then automatically redirect to another URL. How do they do this? The only way I am able to put a redirect statement is before the <html> statement, which immediately redirects, without being able to show the page that is doing the redirection for a few seconds, as I want to.
0
chekhov
Asked:
chekhov
  • 3
  • 2
1 Solution
 
jhanceCommented:
You do it like this (example in PERL)

#!/usr/bin/perl

print "Location: www.moved.com\n\n"


The actual temporary display is performed by the browser and is handled differently by different brands.  The Location response, it what triggers that to happen.
0
 
bass5763Commented:
You can do it in HTML with the command:
<META HTTP-EQUIV="Refresh" CONTENT="60; url=page.htm">

make sure you put it in between<HEAD> </HEAD>
the 60 is the amount of seconds you want it to wait before moving on. the URL is the page to goto.

Thanks,
Matt Calhoun
0
 
chekhovAuthor Commented:
bass5763: you gave me the correct answer, but I can't assign it to you because you entered it as a comment, not as an answer. Please reenter it as an answer.
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
bass5763Commented:
First, you have to re-open the question in order for me to answer it.

Thanks,
Matt Calhoun
0
 
chekhovAuthor Commented:
bass5763: it's reopened now
0
 
bass5763Commented:
You can do it in HTML with the command:
<META HTTP-EQUIV="Refresh" CONTENT="60; url=page.htm">

make sure you put it in between<HEAD> </HEAD>
the 60 is the amount of seconds you want it to wait before moving on. the URL is the page to goto.

Thanks,
Matt Calhoun
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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