title: Nuxt.js - add trailing slash to URL's with params
body: <p>This question is based in <a href="https://stackoverflow.com/questions/54346345/nuxt-js-force-trailing-slash-at-the-end-of-all-urls">this previous one</a></p>
  
  <p>I want all my URL's to end with slash for SEO reasons. So far I have this function working with <a href="https://github.com/nuxt-community/redirect-module" rel="noreferrer">nuxt-redirect-module</a></p>
  
  <pre><code>redirect: [
      {
          from: '^.*(?&lt;!\/)$',
          to: (from, req) =&gt; req.url + '/'
      }
  ]
  </code></pre>
  
  <p>This checks the url, and adds a <code>/</code> at the end in case that there is not. The problem is when the url has params at the end.</p>
  
  <p>So right now, this redirects</p>
  
  <p><code>https://example.com/folder</code> to </p>
  
  <p><code>https://example.com/folder/</code> (intended behaviour)</p>
  
  <p>But <strong>with params</strong>, right now it works like this:</p>
  
  <p><code>https://example.com/folder?param=true</code> to </p>
  
  <p><code>https://example.com/folder?param=true/</code> (it adds the <code>/</code> <strong>after the params</strong>)</p>
  
  <p><strong>QUESTION</strong> </p>
  
  <p>Which would be the way to make it so it would redirect instead from </p>
  
  <p><code>https://example.com/folder?param=true</code> to </p>
  
  <p><code>https://example.com/folder/?param=true</code> 
  (so it would add the <code>/</code> at the end of the url but <strong>before the params</strong>)</p>
  
  <p>Thanks in advance!</p>