My page can be accessed through domain.com or www.domain.com
I am trying to have a redirect for users on mobile devices to the domain.com/m or *www.domain.com/m*
However I am having difficulties to do this correctly. I have put this in my .htaccess on index.php of domain.com
How to do this correctly?
RewriteCond %{REQUEST_URI} !^/http://www.domain.com/.*$
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteRule ^(.*)$ /m/ [L,R=302]