Results 1 to 5 of 5

Thread: Redirect

  1. #1
    Join Date
    Oct 2007
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Redirect

    Hello,

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

    1. Person visits website
    2. Person gets redirected to page
    3. 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.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You could give the <meta> tag a shot.
    Give this code a try:
    Code:
    <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
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Oct 2007
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Oct 2007
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •