PHP redirect based on cookies Issue
-
Hi I want all my new / 1st users to my site to get redirected to a different page.
Its a wordpress page and in the index.php file I have this code right on top
<?php if ($_COOKIE['iwashere'] != "yes") { setcookie("iwashere", "yes", time()+20000); header("Location: https://howtobuygoldoffshore.com/sitemap"); exit; } ?>
Now the issue is when I clear all cache and cookies from my browser and access this page it only goes to howtobuygoldoffshore.com instead of going to howtobuygoldoffshore.com/sitemap.
But now if I access it with a https://www.howtobuygoldoffshore.com then it goes to the correct landing page.(the www. is making some different I suppose)
What could be the issue? Is the code correct which I am writing and inserting in the index.php file or is there some issue with the re direction?
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘PHP redirect based on cookies Issue’ is closed to new replies.