title: Angular 4 Cannot match any routes in production build only
body: <p>I have an Angular 4 (4.4.4) ng-cli app.</p>
  
  <p>Here are my routes:</p>
  
  <pre><code>export const routes: Routes = [
      { path: '', component: DefaultComponent },
      { path: 'somethingcool/:val', component: DefaultComponent },
      { path: 'login', component: LoginComponent },
      { path: 'some-where', component: SomeOtherComponent, canActivate: [AuthGuard] },
      { path: '**', redirectTo: 'login' }
  
  ];
  
  export const routing: ModuleWithProviders = RouterModule.forRoot(routes); 
  </code></pre>
  
  <p>Inside <code>SomeOtherComponent</code> i access optional query parameters like so:</p>
  
  <pre><code>constructor(private route: ActivatedRoute) { }
  
    ngOnInit() {
       this.route.queryParams.subscribe(p =&gt; {
        this.someValue = p['some-parameter'] == "true" || false;
      });
    }
  </code></pre>
  
  <p>When i debug the app locally (<code>ng serve</code>) this works perfectly.</p>
  
  <p>When i do a <code>ng build --prod</code> i am instead getting a <code>Error: Cannot match any routes. URL Segment: 'some-where'</code></p>
  
  <p>EDIT: Specifically, if i go to <code>https://myurl/some-where</code> it works, but <code>https://myurl/some-where?some-parameter=true</code> doesn't. If i host them locally (<code>http://localhost:4200</code>) then this works.</p>