View Full Version : Domain redirection + timer? Does that exist?
infernostudio
Oct 10th 2007, 9:50 am
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?
ste.richards
Oct 14th 2007, 1:51 pm
I would suggest using the PHP header function with some conditions in to determine whether the domain should be redirected or not.
infernostudio
Oct 16th 2007, 1:59 pm
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 18th 2007, 11:50 am
Can Anyone help?
moodswing
Oct 20th 2007, 3:00 pm
Please explain more thoroughly. :)
upl8t
Oct 22nd 2007, 12:36 pm
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();
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.