Translator

English flagChinese (Simplified) flagChinese (Traditional) flagDutch flagFrench flagGerman flagGreek flagItalian flag
Japanese flagKorean flagPortuguese flagRussian flagSpanish flag   
By N2H

How do I redirect people using an iPhone to a different page or portion of a website?

August 11th, 2008 by iPhoneTechZone

Ever wanted to point iPhone users to a specific section of your website but didn’t know how? It’s fairly simple by adding a few lines of javascript.

How do I redirect iPhone users to a different page/site:

<script type="text/javascript">
<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{
location.href='http://www.website.com/iphone';
}
// -->
</script>

// Paste it somewhere in your <head> ....... </head

Posted in iPhone | No Comments »



Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.