I have several Index.php files, such as (index.php, index2.php, index3.php, etc.), I also have a database with different ID addresses. when someone enters the index file, the landing pages are displayed dynamically, and only the specified parameters in the database change some of the displayed parameters, say, I enter domain.com/index.php?id=2 - this is for X and domain.com /index2.php?id=112 displays a page for city Y.
So far so good ..
now I am trying to insert an Iphone discovery code that will redirect users who enter URLs from iphone to iphone friendly design. so I created i-index.php, pasted the following code into the index.php page:
<?
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod'))
{
header('Location: http://www.mydomain.com/mobile/i-index.php');
exit();
}
?>
and now when I enter the url mydomain.com/index.php?id=1 from my iphone, I am redirected to the i-index.php file, but not to the specified ID (? id = 1).
I hope my explanation does not confuse. can anyone suggest a way to redirect the specified identifier (both the source index and the mobile index are correctly connected to the database)
thank
source
share