I would like to do something similar. I have my site set up to detect a finite list of mobile browsers and serve up a mobile-friendly version of the site. However, there is no way I can enumerate ALL possible mobile browsers so I want to have the option to just let them go to the /mobile directory. Then mod_rewrite to the root directory but with a variable set.
I can force the mobile theme one of two ways: either add "&mobile=1" to all URL's or better yet I would rather force the $HTTP_USER_AGENT variable to a known mobile browser, like "WebPro".
First, is it possible to modify that user agent variable using mod_rewrite? If not, then setting "mobile=1" would be OK, but I don't prefer that as my stats by page (and possibly the search engine stats) would be off.
Another important thing I don't understand is how subsequent clicks on URL's from the redirected page (no /mobile) will still retain the /mobile directory so that subsequent mod_rewrites continue to add the "&mobile=1".
This is what I'm thinking anyway, but it may be too complex and someone has a better idea...
TIA!