Score:0

Appending query parameters to specific URI

in flag

I'm trying to append the query string ?sort_by=id&dir=ASC&lim=2&flt=1 to any traffic going to /admin/users.php, which should result in:

/admin/users.php?sort_by=id&dir=ASC&lim=2&flt=1

I was attempting to follow this question/answer:

nginx rewrite append a parameter at the end of an url

By doing the following:

location /admin/users.php {
  rewrite  ^(.*) $1?sort_by=id&dir=ASC&lim=2&flt=1 break;
}

Also tried:

  location /admin/users.php {
    rewrite  ^ /admin/users.php?sort_by=id&dir=ASC&lim=2&flt=1 last;
  }

But any traffic going to /admin/users.php comes back without the query string added. I'm obviously doing something wrong.

Any suggestions for implementing this correctly?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.