Q:

Check mobile device in apache and redirect to mobile website

I want to check if user is using mobile device or regular system and redirect him to either mobile or normal site using apache. Is this possible?
I tried code like 
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteRule ^$ http://m.example.com/ [L,R=302]
</IfModule>

in .htacess and it did not have any effect. Is this correct ?

A:

Easiest way is to use Apache Mobile filter.
http://www.apachemobilefilter.org/setuponline/

A:

Firstly, how are you testing this?
Secondly, try the following RewriteRule instead of the one you are using.
RewriteRule ^.*$ http://m.example.com/ [L,R=302]

Finally, as an extra piece of advice, i would also consider the following:

Using the Apache Mobile Filter instead of a Regex. It is more accurate and provides a greater range of features
You should allow users to choose the representation/experience that they want. So if you are presenting them with the mobile version, then you should let them choose the desktop version instead since this might actually have been what they wanted; and vice versa.
This could be for a plethora of reasons e.g they have bookmarks to the desktop, someone shared a url to the desktop version etc. etc. Your content negotiation technique is pretty basic and doesn't take into consideration any of these use cases.

