Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm trying to set up a mobile version of a site, and I'm wondering if I can just set up a m subdomain and put the mobile site in there, or if I need to set up some kind of redirect to make phones automatically go to it.

Could you point me in the right direction for getting started on this? I'm having trouble finding good info.

Thanks

share|improve this question
add comment

3 Answers

detectmobilebrowser.com redirection is based solely on the UserAgent string which can easily be modified using an add-on on Firefox, or any other method. Also, some mobile operator will change the UA string so it can make UA redirect more unstable. You can find many services working like this one.

wurlf is using some feature detection in addition to the UserAgent. Additionally, you can get some useful info about the device like screen size. This will help you render a version of your website that is best for your visitor.

So if you want to stick with free device recognition, I'd go with wurlf.

share|improve this answer
add comment

You will definitely have to build your own redirect. It really depends on you language as to how to do it.

Also, this was asked on SO a while back, here. Check out WURLF as the SO answer suggests.

When you make the redirect you will want to make sure to use a 302 Redirect.

share|improve this answer
    
+1, Didn't know about WURLF. Gonna have to bookmark it for future reference. –  John Conde Aug 18 '10 at 17:06
    
Cool, thanks I didn't know about detectmobilebrowser.com so +1 for that one my friend! –  RandomBen Aug 18 '10 at 17:09
add comment

Unless I missed something I do not believe this is automatic. These sites have made a special mobile versions of their site and are redirecting them there automatically through code on their servers.

If you know PHP there is a handy PHP code generator that will create the code for depending on your exact needs. This site seems to offer many more languages. I bet if you looked hard enough you could find a set of Apache rules to do this, too. It looks like the gist of i is to search the user agent and look for signs of the mobile phone manufacturer. So the key is to make sure this list is kept up to date.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.