The problem is, the site is entered with www in url in a mobile device
with
parameters in the url, it is redirected from www.domain.com to
m.domain.com
but the parameters entered with www.domain.com/parameters when
redirected to
m.domain.com doesn’t receive the parameters from thr url origin in www.
In conclusion www.domain.com/parameters should redirect to
m.domain.com/parameters but is redirected to m.domain.com, the
parameters
are clean. Is there a way no to clean it ?
The www config is the following :
server {
listen 80;
server_name www.domain.com;
…
#to detect if the device with www entered in domain is mobile
if ($http_user_agent ~*
‘(iPhone|iPod|iPad|Android|BlackBerry|webOS|Windows Phone)’) {
rewrite ^ http://m.domain.com$uri;
}
}
The mobile configuration is
server {
listen 80;
server_name m.domain.com;
...
}
Posted at Nginx Forum: