Making nginx check parameter in url

You better use http://example.com/?mobile=1 (argument with value). In this case checking is simple:

if ($arg_mobile) {
    return 302 http://m.example.com/;
}

Checking for argument existance is usually done with regexp like if ($args ~ mobile) but it’s error-prone, because it will match mobile anywhere, e.g. http://example.com/?tag=automobile.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)