I have three links on my page that look like this http://www.mydomain.com/page2.php?keyword=green http://www.mydomain.com/page2.php?keyword=red http://www.mydomain.com/page2.php?keyword=blue all page2.php is is a redirect page. how can i define what url page2.php redirects to based on the keyword variable in the url? thx
$locations = array( // Keyword => URL 'green' => 'http://example.com', 'red' => 'http://example.com', 'blue' => 'http://example.com' ); if (isset($locations[$_GET['keyword']])) { header('Location: '. $locations[$_GET['keyword']]); } else { header('Location: http://example.com/default.html'); } exit(); PHP: