Quick search revealed many guides explaining how to detect an iPhone or iPad:
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} iPhone
RewriteRule .* http://iphone.example.com/ [R]
but is there any way to detect a Mac user (any browser), and redirect him?
Macintosh UserAgents looks like something like this : Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
As far as I know, RewriteCond %{HTTP_USER_AGENT} will look for the regular expression you gave him. In the mentioned case, if he finds iPhone in the User-Agent, the condition test will return true. So it should be possible to do something like this :
RewriteCond %{HTTP_USER_AGENT} Macintosh
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^ http://mac.example.com%{REQUEST_URI} [R]
Hope this works, and hope this helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With