Log in

View Full Version : Redirect



pssparkman
02-27-2008, 07:15 AM
Hello,

I would like to make a redirect on my website, but if possible do it this way:


Person visits website
Person gets redirected to page
Then after "x" amount of time person gets redirected back to the main page without getting redirected again



The issue is that my website has so many links back to the index page on so many pages and it would be a pain in the butt to create a new index page and then rename all the other index pages to another name and fix all the links so that once they view my redirected page they don't have to go there again, they can just go to the main website page. So if I can have something that only shows the redirect once for who ever visits, say the use of a cookie or something that would be great.

Thanks.

rangana
02-27-2008, 07:39 AM
You could give the <meta> tag a shot.
Give this code a try:


<META HTTP-EQUIV="REFRESH" CONTENT="X;URL=yourpage.html">


Where X is the amount of time in seconds where the user will be redirected.
The URL is the url address you want the user be redirected after the X seconds.

See if it helps :D

pssparkman
03-03-2008, 11:53 PM
Okay I have the redirect to work just like I want and it works fine, but how can I get it to display the amount of seconds that it will redirect to the page.

Something like "You will be directed to [page] in X seconds", and have seconds countdown to show when it will happen.

djr33
03-04-2008, 12:05 AM
That has nothing to do with the redirect code, but rather just adding it to the page. Just write out in text you will be redirect in ** seconds, and then add the same length in the code, and you're done.
Now, if you want to make it work with Javascript, you can use any countdown script you'd like (search around for one that fits), and you can even use Javascript to redirect after the countdown precisely, but having the meta tag backup or even better a server side redirect header, would be best.

pssparkman
03-04-2008, 12:15 AM
Okay. I knew it didn't have anything to do with the redirect script, but I had forgotten about the countdown codes. Thanks, now I can finish the page I am working on.