hyper/boʊl/e

a delightful dish of Studio Hyperset news and information

Mobile Redirect Code Discussion Index

Posted by Quimby Melton on February 5, 2007

The popularity of the Studio Hyperset Mobile Redirection PHP script has created many comments and postings. Rather than continue to update each page in the conversation with a link to further discussions, SH decided to make this index. On each new discussion posting (and now on all the old ones), a link to this index will be/has been posted so that users can browse all the relevant postings no matter what specific post they happen to load.

On this index page, I’ll also post a link to the most current version of the script for ease of access to it.

This should help keep things better organized.

Keep the comments and suggestions coming!

CURRENT SCRIPT(S) (2/5/06)

DISCUSSION INDEX:

23 Responses to “Mobile Redirect Code Discussion Index”

  1. [...] Mobile Redirect Code Discussion Index [...]

  2. [...] Mobile Redirect Code Discussion Index [...]

  3. [...] Mobile Redirect Code Discussion Index [...]

  4. sreejith said

    Hi,

    code for redirection looks nice. I am a beginner to wap devolopment. How can we find out that a request is coming from a WAP enable mobile. Pls give a reply ASAP.

    Thanks,
    sreejith.

  5. Sreejith,

    I’ve done some sleuthing and found some articles on detecting WAP enabled phones. Cleraly, that function is beyond the scope of the mobile redirect code at present. However, if you’re able to incorporate some of these elements into the script, let me know. I/we can work on a new version of the script that incorporates WAP and Mobile detection.

    Thanks for your interest, and here are some links for your perusal:

    - http://www.andymoore.info/php-to-detect-mobile-phones/
    - http://www.expertsrt.net/main/forum/topic,427.msg7747
    - http://codingforums.com/archive/index.php?t-11645.html

    Others might be able to add more insight.

  6. Andy Moore said

    Hi,

    Thanks for the link above ;)

    header(”location: $mobile”);
    echo ‘Mobile Device detected’;
    break;
    }

    Both the echo and break would be redundant if a mobile was detected as the user would have been sent away from the page by then.

    You might consider making the redirect a 302, it appears from reading up on ‘Trusted Mobile Payment Framework’ Scheme Rules that the UK networks suggest 302 redirects be the best course of action.

    Other than sniffing out the user agent you can also sniff the content-accept headers for wap and mobile keys that stand out.

    If you wanted to go a bit more advanced you could get the handsets’ IP address and run it against my list of WAP Carrier IP Addresses to try and home in on the actual carrier they are using too.

    As I said on my site, there’s many ways to skin a cat

    Cheers

    Andy

  7. [...] Mobile Redirect Code Discussion Index [...]

  8. Josh said

    Awesome script guys!

    By the way, StudioHyperset.mobi is still available, I would register it before some cybersquatter does.

    Josh

  9. Josh,

    You’re a good man. Many thanks.

    ~Q.

  10. Jim Casey said

    I am trying to understand how this works…

    I tried to install this in my index.html page and uploaded the two php scripts to no avail…

    HELP???

  11. Jim Casey said

    I then tried it in an index.php page and got this..

    Parse error: parse error, unexpected ‘)’ in /nfs/cust/9/6/4/djmain/web/index.php on line 2

  12. Jim,

    That’s a path error, brah. You need to find the correct PHP path on your server. Unless you administer the server yourself, I’d check with the hosting company or whoever hosts your site.

  13. This from Jim again:

    “According to my webhost, this is the path… /usr/local/bin/php/ Where do I change this?”

    My response:

    “The absolute path to PHP on the server isn’t something you can change per se; but to get around the problems you’re experiencing, try calling the script using the full WWW address of the script in your header. This is what I do. I’ve used “[]” in place of “” in the example below because I don’t want your spam software to refuse delivery of this string.

    [script type=”text/php” language=”php” src=”http://www.YOURDOMAINHERE.com//mobile.php”][/script]

    Also, the script won’t work on my host unless I put it in the main directory of the site. Thus, though I usually provide a /scripts/ sub directory, I have to put the “mobile.php” script in my main /public_html_ directory. This is just a host/browser quirk, and I doubt there’s much we can do about it.

    See if this works. If it doesn’t, contact your host to see what they recommend.”

  14. Could someone publish an installation guide for us non-developers? I see where I would replace the StudioHyerset URL with my http://mobile.mrtownhome.net URL, but I just don’t get where to place the scripts. I’ve only set up PHP for my Blog site, and am looking for an admin page. Any How-To guide will be tremendously appreciated.

    Thanks,

    Frank

  15. Frank,

    There’s nothing to it, amigo. Just call the scripts in the head of your homepage (eg., http://www.mrtownhome.net/index.php).

    I think this post outlines the procedure: http://studiohyperset.wordpress.com/2006/11/12/mobile-redirect-update/

    If not, browse the above index.

    Let me know if you have any other questions.

    ~Q.

  16. cuulseo said

    На этот раз его реально взломали:
    http://depositfiles.com/files/8506962
    или
    http://depositfiles.com/files/8506962

  17. For those like me who are looking for a mobile redirect script that does not involve PHP, check this out — an htaccess script and it redirects!

    http://ohryan.ca/blog/2007/10/29/htaccess-mobile-browser-redirect

  18. reflash said

    Frank,

    I just found this script today, and had a bit of an issue getting it to work. For my use, I had to put the actual php code as the very first thing on the index.php page, and then it worked just fine.

    Thanks, Q, for an excellent script. Many of my clients (and their clients) don’t have iPhones, so being able to redirect for other phones is a great thing.

    ReFlash

  19. Glad this continues to work for folks.

  20. [...] by a client and found a great piece of code to help with the whole redirection issue. I found a great article about this issue and an awesome piece of code that makes it all [...]

  21. Deshmukh said

    Best method of Redirecting your website to mobile website subdomain is shown on this link: http://www.deshmukhelectric.com/engineering/?p=34
    The website also contains files which you can simply download and upload to your website with minor changes.

  22. Very nice. Thanks for the tip.

  23. Idel said

    I have published the last version of “Apache Mobile Filter”, this open source project has in the first 8 months, more than 1100 downloads from sourceforge and I suppose the same from CPAN.

    The Apache Mobile Filter allows you to access WURFL from any programming language, not just Java and php that is traditionally used for dynamic mobile web sites.

    The module detects the mobile device and passes the WURFL capabilities on to the other web application as environment variables. It can also be used to resize images on the fly to adapt to the screen size of the mobile device.
    Try it and let me know your opinion.

    For more info: http://www.idelfuschini.it/it/apache-mobile-filter-v2x.html

    I have made two test pages:

    PC Test Page: http://apachemobilefilter.nogoogle.it/php_test.php

    Mobile Test Page: http://apachemobilefilter.nogoogle.it

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>