Hi
I am runing joomla site www.mysite.com with nginx rewrite
try_files $uri $uri/ /index.php?$args;
I need to setup 302 redirect to m.mysite.com for mobile user excluding search bot. below are the codes I test in vhost
# 1. Only redirect mobile real user to m.mysite.com (WORKING) 2. no redirect for bots using prerender bot detection codes (WORKING) 3. no redirect for non mobile user. (404 ERROR)
location ~/myshop {
set $mobile_redirect 0;
if ($prerender = 0) {
set $mobile_redirect "${mobile_redirect}1";
}
if ($mobile_rewrite = perform) {
set $mobile_redirect "${mobile_redirect}2";
}
if ($mobile_redirect = "012") {
return 302 https://m.mysite.com;
}
try_files $uri $uri/ /index.php?$args;
}
case 3 got 404 error, and I wonder why?
thanks