Is it possible to detect iPhone browser agent in .htaccess and redirect the user to the correct iPhone page?
Here's a simplified RewiteRule that combines the mobile user agents into a single condition:
# Redirect Mobile Devices
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|iemobile" [NC]
RewriteRule ^(.*)$ http://m.example.com/$1 [R=301,L]
You'll notice that the [NC] nocase flag is set, which causes the RewriteRule to be matched in a case-insensitive manner.
That is, it doesn't care whether the user agents strings appear as upper-case, camel-case or lower-case in the matched URI. (e.g., IPHONE vs. iPhone vs. iphone).