Domain redirection + timer? Does that exist?

Discussion in 'MySQL' started by infernostudio, Oct 10, 2007.

  1. #1
    I am looking for some kind of script, apps, or any kind or program that will let me have a complete archive of all of may domains and basically redirect each one to either my server, parking program or affiliate pages. I know there are certain scripts out there with a control panel to organize /redirect domains but I want to take my domains one step furthur and have some of them redirect only on a hour, day, week, month schedule. This step is very important since some of my domains perform better at certain times of the day, week and/or month.

    Is there anything out there that can do this?
     
    infernostudio, Oct 10, 2007 IP
  2. ste.richards

    ste.richards Guest

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would suggest using the PHP header function with some conditions in to determine whether the domain should be redirected or not.
     
    ste.richards, Oct 14, 2007 IP
  3. infernostudio

    infernostudio Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Someone has suggest to do this, but I have no idea where to start :(
    Can someone help with some pointers :) Thanks!


    Just create a MySQL database with the domain,redirect_on,redirect_off,redirect_to

    then just have like:

    domain1.com,10:00:00,14:30:00,http://www.server
    domain1.com,14:31:00,23:59:59,http://www.parking.program
    domain1.com,00:00:00,09:59:59,http://www.affiliate.page

    etc etc

    When someone visits your page it will get the domain and time, access MySQL and redirect accordingly.
     
    infernostudio, Oct 16, 2007 IP
  4. infernostudio

    infernostudio Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Can Anyone help?
     
    infernostudio, Oct 18, 2007 IP
  5. moodswing

    moodswing Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Please explain more thoroughly. :)
     
    moodswing, Oct 20, 2007 IP
  6. upl8t

    upl8t Peon

    Messages:
    80
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Create the table like you said:

    Domain, RedirectStart, RedirectEnd, RedirectTo

    Then do a select on that table using something like:

    SELECT DISTINCT * FROM Redirects WHERE Domain = 'domain' AND RedirectStart <= NOW() AND RedirectEnd >= NOW()

    That will get you every record that matches the domain, where the current time is between start and end.

    If you get no records, then you have nowhere to redirect to.

    If you get multiple records, well that's up to you, whether you put another field in to sort by, or whether you should even get multiple records.

    Once you get the record you want just do a basic redirect:

    header('Location: ' . $redirect_to_from_db);
    exit();
     
    upl8t, Oct 22, 2007 IP