title: nginx location regexp for query string
body: <p>I want to redirect anything that comes directly to my server with perticuler query string to other location in same domain.</p>
  
  <p>If  user comes to </p>
  
  <pre><code>http://www.mydomain.com/?abc=js9sd70s
  </code></pre>
  
  <p>I want to redirect it to </p>
  
  <pre><code>http://www.mydomain.com/otherpath/?abc=js9sd70s
  </code></pre>
  
  <p>the query string <code>?abc=js9sd70s</code> should be the same to new url.</p>
  
  <p>Please suggest nginx config file.</p>
  
  <p>I have tried most of the alternative for below code. by keeping '\' before ? and = sign.</p>
  
  <pre><code>        location ~ /?abc=.* {
                  rewrite ^/(.*)$ http://www.mydomain.com/otherpath/$1 permanent;
          }
  </code></pre>
  
  <p>Please suggest me this location change.</p>