title: How can I use regexp to match ctx.url like ''/?id=xxx'' and "/" in koa?
body: <p>When I type <code>/</code> in browser, the koa <code>ctx.url</code> info is <code>/</code>.<br>
  When I type <code>/?aaa=23322</code> in browser, the koa <code>ctx.url</code> info is still <code>/?aaa=23322</code>, How can I use regexp to match <code>ctx.url</code> like <code>/?id=xxx</code> and <code>/</code> in koa?</p>
  
  <p>My code, when the guest access <code>/</code> and <code>/admin</code> , the app would redirect to <code>/login</code>, but when the guest access <code>/?aaa=aaa</code> , will bypass the 
  auth condition.</p>
  
  <pre><code>if ((ctx.url === '/' || ctx.path.match(/^\/admin/)) &amp;&amp; !ctx.session.userInfo) {
      // auth
      await ctx.redirect('/login');
      return false;
   }
  </code></pre>