iPhone redirect

Page 1

iPhork in the Road

4.9.2011

this is the best script of the many I have I tested* (it's less intrusive than the php and especially .htaccess scripts I came across) for redirecting iPeople away to your non-Flash site version or other mobile device users to a mobile formatted version (larger type/smaller images). it's javascript and thus universal across all browsers and platforms: <script> <!-if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/ i)) || (navigator.userAgent.match(/android/i)) || (navigator.userAgent.match(/ opera/i)) || (navigator.userAgent.match(/blackberry/i)) || (navigator.userAgent.match(/palm/i)) || (navigator.userAgent.match(/windows ce/i))) { location.replace("http://www.onestopdesktop.com/mobile.html"); } --> </script> copy it and paste it in Dreamweaver in your index.html page inside the <head> like below:


of course, you will substitute your mobile web address for mine. you can leave the other mobile devices out of the coding since they can read Flash unless you make a special size and format version just for phones that you can specifically redirect them to. note that many phone surfers complain tha compulsory redirection is not a great idea. they want access to the full site (unless Flash is an integral part of it). they don't want to be treated like babies. their phones can handle it, and they want all the info everyone else is getting, etc., but larger sites like yahoo and google, CBS radio and commercial giants like newegg.com do. it's strictly up to you. it does make sense to have smaller images (for quicker upload to 3G networks), and larger type for better legibility for these kinds of devices, and a simple workaround after mobile users have been redirected is to include a link back to the full site (another almost identical index page that doesn't include this script; otherwise you'll get a loop). you could have one specifically for iPhones/iPods for the Flash incompatibility issues and another for the rest of the mobile phones; even one for iPads and another for other web surfing pad sized devices by adapting this script. you can test my website to see it work if you have any of the devices listed above ( http:// www.onestopdesktop.com . you will know you are at the mobile site a) because it says so in the browser bar, b) because you are looking at an animated gif version of my flash animation which will have no sound. so can can Flash it up to your hearts content, create Flash XML slideshows, use flv's instead of quicktime movies for your video formatting, etc., on your very own specialized Flash version and have an html, css, javascript based version waiting for iPholks to peruse.

*http://benjamincharity.com/2011/01/load-script-only-on-mobile-browser/


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.