FINAL UPDATE: Detecting and automatically redirecting website visitors who visit a standard webpage / website on mobile, handheld, wireless, PDA, or cel / cell phone devices / browsers to a mobile version of the webpage or website
Posted by Quimby Melton on December 9, 2006
For an up-to-date list of posts/comments on this topic and a link to the most current version of the script(s), visit the MOBILE REDIRECT CODE DISCUSSION INDEX.
This is the final posting of a conversation begun October 8th and continued on November 12th re: detecting and automatically redirecting website visitors who visit a standard webpage / website on mobile, handheld, wireless, PDA, or cel / cell phone devices / browsers to a mobile version of the webpage or website.
Thanks to a helpful hint from “Megan” on the 11/12 posting, I was able to stop the PHP script from looping and found a useful way to have it executed when the index.php homepage loads.
I also combined the HTTP_USER_AGENT strings in the moble.asp and mobile.php files to create one PHP file (mobile.php). This make the mobile.asp file largely unnecessary, but I’ve included it in the final .zip file below (redirect3.zip) for the sake of those who prefer ASP to PHP and would like to experiment with/use that language. The mobile2.asp file is also included on the Studio Hyperset site, but I suspect it’s largely non-functioning. The unified PHP file (mobile.php) works fine, though, and seems to be automatically driving visitors using a mobile device to the Studio Hyperset mobile page. This is true for whatever device Megan tested the script on and Studio Hyperset co-founder Isaac Melton’s LG Chocolate phone.
In the interest of bearing witness to full development of this project, I stripped out three HTTP_USER_AGENT strings that appeared in the mobile.asp file in the outside chance that they would inadvertently redirect visitors using standard laptops/desktops to the SH mobile site: “Dell,” “Compaq,” and “Toshiba.”
Finally, here’s how I’ve included the mobile.php and mobile2.asp files in the code of the Studio Hyperset homepage:
At between the <head> tags, I’ve placed the following lines of code. Note the absolute file source links:
<?php include (’http://www.studiohyperset.com/scripts/mobile.php’); ?>
<!–#include file=”http://www.studiohyperset.com/scripts/mobile2.asp” –>
Here’s the final .zip file containing all the mobile redirection scripts: redirect3.zip.
Detecting and automatically redirecting website visitors who visit a standard webpage / website on mobile, handheld, wireless, PDA, or cel / cell phone devices / browsers to a mobile version of the webpage or website « hyper/boʊl/e said
[...] FINAL UPDATE: Detecting and automatically redirecting website visitors who visit a standard webpage / website on mobile, handheld, wireless, PDA, or cel / cell phone devices / browsers to a mobile version of the webpage or website [...]
Rooster said
iPhone support?
Oliver Melton said
Doesn’t need it:
:: http://studiohyperset.wordpress.com/2007/06/15/studio-hyperset-mobile-redirection-code-and-the-iphone/
David said
So you are the ones responsible! I want to know how to *stop* being redirected to, for example, ebay mobile, yahoo mobile etc etc whilst on my pc.
Could you all please undo whatever it is you did.
Thanks,
D
Oliver Melton said
Assuming this is a joke, I’ll just say, “Ha!” and move on.
Ciprian said
Is this redirect3.zip from december 2006? Why I can’t make it work with My Nokia E50 nor OperaMini 4.2 (latest as of today)?
Oliver Melton said
I’m not really updating the user agents anymore. Using some of other comments, I think you should be able to edit the scripts, though, and make them work for your purposes.
Ciprian said
Ok, that’s what I expected. It’s hard to keep up to date on nowadays fast progress.
Anyway, it would be useful if anyone knows of an up-to-date list of all mobile (and not only) agents.
Thanks!
Oliver Melton said
Check this out:
:: http://www.zytrax.com/tech/web/mobile_ids.html
I think this is the page I used way back in aught 6 to make the original script. Also, try Googling “mobile user agents.”
Ciprian said
…I mean, the purpose was to make it as broad available as possible, not to work on my own cell phone… That was just a test from my Nokia.
Ciprian said
I guess this helps, thank you for your post Oliver!
http://www.zytrax.com/tech/web/mobile_ids.html
Oliver Melton said
Pleasure …