title: Asp.Net Core middleware pathstring startswithsegments issue
body: <p>Have a Asp.NET Core 2.0 application and I would like to map any path that does not start with <code>/api</code> to just reexecute to the root path.  I added the below but doesn't seem to work:</p>
  
  <pre><code>app.MapWhen(
     c =&gt; !c.Request.Path.StartsWithSegments("/api", StringComparison.OrdinalIgnoreCase),
     a =&gt; a.UseStatusCodePagesWithReExecute("/")
  );
  </code></pre>
  
  <p>Not using MapWhen() and just using <code>app.UseStatusCodePagesWithReExecute("/")</code> works for all paths not root.  Just want to add filtering for all paths not root and not <code>/api</code>.  Any ideas on how to do this?</p>