title: Redirecting to a url with queryParams
body: <p>I'm creating a redirect in angular 6</p>
  
  <p>The redirect itself is very simple it works like this</p>
  
  <p><strong>get destination url from params</strong>:</p>
  
  <pre><code>this.returnUrl = this.route.snapshot.queryParams['route'] || '/';
  </code></pre>
  
  <p><strong>Redirect</strong></p>
  
  <pre><code>if (this.returnUrl) {
    this.router.navigate([this.returnUrl]);
  } else {
    this.router.navigate(['/']);
  }
  </code></pre>
  
  <p>The problem I have in when the url has parameters in it, for example:</p>
  
  <p><strong>Redirect URL</strong> is</p>
  
  <p><code>'/survey/finish?key=7krmpqpC0P&amp;mind=Akkoord&amp;companyNumber=%5B%5BQ2%5D'</code></p>
  
  <p>As a result I get the <strong>error</strong></p>
  
  <p><code>Error: Cannot match any routes. URL Segment: 'survey/finish%3Fkey%3D7krmpqpC0P&amp;mind%3DAkkoord&amp;companyNumber%3D%255B%255BQ2%255D'</code></p>
  
  <p>How can I correctly redirect to the given <strong>string</strong>?</p>
  
  <p>So <code>http://localhost:4200/survey/finish?key=7krmpqpC0P&amp;mind=Akkoord&amp;companyNumber=%5B%5BQ2%5D</code></p>
  
  <p>My route looks like thid</p>
  
  <pre><code>  {
      path: 'survey/finish',
      component: CallbackComponent,
      canActivate: [AuthGuard]
    }
  </code></pre>