PDA

View Full Version : Detect Browser and redirect from iphone


javierrebelde
02-01-2010, 04:44 AM
Hi,

I need help, i am looking for a script to redirect a recular computer user to a regular site when access my iphone website.

so, pc redirect from iphone site to a pc site

edbr
02-01-2010, 06:17 AM
check out ismobile

javierrebelde
02-01-2010, 06:59 PM
Hi,

I think you did not understand what i need.

i just need a script redirect code, if a pc user acces my iphone site the script regconize him as a pc user and send him to a regular site.

edbr
02-01-2010, 11:03 PM
yes i did, ismobile is a browser detect script which you can then use ro redirect i use it with php i am not sure if it uses other serverside though.
2 minutes yahoogling found this , not much effort, for javascript which is ok providing it is enabled. Not tested
<script language=javascript>
if(
(navigator.userAgent.match(/iPhone/i))
|| (navigator.userAgent.match(/iPod/i)))
{
location.replace("URL HERE");
}
</script>