I want to force users to goto my main page (http://www.mysite.com/index.php)
If the user is outside of my page, ex: google.com
I don't want them to be able to type http://www.mysite.com/index.php?q=1 and goto q=1
instead if they type http://www.mysite.com/index.php?q=1 i want them to be redirected to http://www.mysite.com
once they have visted the main page, http://www.mysite.com, then they can follow links to index.php?q=1
Any suggestions or code snippets would greatly be appriciated.
Thanks.
{RESOLVED} Force Start Page
Moderator: General Moderators
Code: Select all
$domains="www.mysite.com,mysite.com";
$domains=explode(",",$domains);
if($_GET['q']!="") {
$referer=explode("/",($_SERVER['HTTP_REFERER']));
if(!in_array($referer[2],$domains)) {
header("Location: http://".$domains[0]."/");
exit();
}
}- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm