stefanlesik Posted April 7, 2014 Share Posted April 7, 2014 Hi - I'm trying to setup a redirect based on query string eg ?id=1 or ?id=2. I can't get the wp_redirect( $iosurl[$_GET['id']], 302 ); exit; to print the array value. Any ideas? Thanks <?php global $iosurl; $iosurl = array( '1' => 'http://domain1.uk/', '2' => 'http://domain2.uk/' ); if(array_key_exists($_GET['id'], $iosurl)) { ?> <?php wp_redirect( $iosurl[$_GET['id']], 302 ); exit; ?> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/287578-wp-redirect-on-id-query-string/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.