Help - Search - Members - Calendar
Full Version: How To Redirect A Page
BleepingComputer.com > Internet & Networking > Web Site Development
   
Martel
I am wanting to have a page automatically redirect the visitors to another page.
Thanks in advance

Moderator Edit: Moved topic to more appropriate forum. ~ Animal
Amazing Andrew
Put the following code between the <head>and </head> tags of your HTML document:

CODE
<meta http-equiv="refresh" content="10;url=foo.html" />



In the above code, 10 is the number of seconds to wait before redirecting and foo.html is the page to which the user will be redirected. You can change these to whatever you need it to be. So, your page would look something like this:

CODE
<html>
<head>
<title>Redirection</title>
<meta http-equiv="refresh" content="10;url=foo.html" />
</head>
<body>
<p>You Will Be Redirected in ten seconds</p>
</body>
</html>
Martel
Thanks again for the help.
clapping.gif
Martel
I added
<html>
<head>
<title>Redirection in progress</title>
<meta http-equiv="refresh" content="10;url=foo.html">

and also tried

<meta http-equiv="refresh" content="10;url= http://www.fooboo.com/foo.html" >
</head>
<body>
<p>You Will Be Redirected in ten seconds</p>
</body>
</html>

on both I got 404

fooboo.com being the site
and
foo.html being the filename

maybe I typed something wrong?
groovicus
Just to clarify, you used your real domain and html page, right?
Martel
yes I did

here it is again names changed for clarification
<html>
<head>
<title>Redirection in progress</title>
<meta http-equiv="refresh" content="10;url=myfilename.html">

and also tried

<meta http-equiv="refresh" content="10;url= http://www.mydomainname.com/myfilename.html" >
</head>
<body>
<p>You Will Be Redirected in ten seconds</p>
</body>

If it matters I entered only the above in notepad then saved as filename.html
as the redirect page
groovicus
The only other thing I can think of is that you are having a path problem. The first example will only work if both html pages are are in the same directory. I'm not sure why your second example isn't working, unless the html page is not where the server expects it to be.
Martel
It is working! clapping.gif

Thanks again, I am not sure what I was doing wrong but I would save it in notepad with a .html name
and then copy it to my server and it asked to overwrite but didn't work.

Then I noticed a page with filename.html.html (typo on my part )
So I saved my notepad .html file in a new directory then copied that one to the server (it did not have a file to overwrite).

And it works.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>





<title>The Page you are accessing has moved</title>
</head>

<title>Redirection in progress</title>
<meta http-equiv="refresh" content="10;url=filename.html">


<body>
<p>Hang on you will be redirected in ten seconds</p>




</center>


</body>
</html>

wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.