Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.5k views
in Plugins by
edited by
http://www.question2answer.org/qa/5684/

if mobile redirect to

http://www.m.question2answer.org/qa/5684/

 

i use this htaccess code. but when a user visit home then it work. if a visitor come from search engine or visit first time such this link http://www.question2answer.org/qa/44205/ then it cannot work.

RewriteEngine On
RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|android"[NC]

RewriteRule ^$ http://m.ans.bissoy.com [L,R=302]

1 Answer

0 votes
by

try replacing

RewriteRule ^$ http://m.ans.bissoy.com [L,R=302]

with

RewriteRule ^$ http://m.ans.bissoy.com%{REQUEST_URI} [L,R=302]

 

by
I try it. But it cannot work.
...