I am having problems with Header redirects on our site, I am using the following code to
<?
if($utm_source==="cj")
{
header('Location:'. $URL);
}
else
{
header('Location:index.php');
}
?>
This is designed so that one of our affiliates can pass the following url http://www.bigdug.co.uk/cj/?utm_source=cj&URL=http%3A%2F%2Fwww%2Ebigdug%2Eco%2Euk%2Facatalog%2FBudget%2Ehtml to the site and get redirected the url as specified in the variable URL.
This works fine when accessing the site using the affiliate link but when users just go to the site by going to www.bigdug.co.uk/cj (i have set up this directory so that i can test it) or bigdug.co.uk/cj/index.php it is just hanging in the browser.
It seems to be an issue with the redirect going to itself when you go through the else, if you change the page you are redirecting to to another page it works fine, so basically i need it to point to itself as I do not want to have to duplicate the homepage.
Any help gratefully received.
Mark