lucy24 - 10:07 pm on Apr 24, 2013 (gmt 0)
It's exactly the same code that you're already using to redirect the "wrong" forms of your domain name-- typically with/without "www." Capture the whole request and attach it to a fresh request under a different (sub)domain name.
Frankly your much bigger problem is UA detection. It may be simpler to detect the non-mobile user agents. Anything left over is then either a robot or a mobile. You also need a way for the human user to override the redirect if that's their individual preference --or if UA detection makes a mistake, which is bound to happen sooner or later.