title: How do I configure routing with two optional route values?
body: <p>This is my route config in <code>Startup.cs</code>:</p>
  <pre><code>app.UseEndpoints(endpoints =&gt;
  {
      endpoints.MapControllerRoute(
          name: &quot;default&quot;,
          pattern: &quot;{controller=Home}/{action=Index}/{id?}/{tab?}&quot;);
  });
  </code></pre>
  <p>Some of my views make use of both <code>id</code> and <code>tab</code>, some just <code>id</code> and some just <code>tab</code>.</p>
  <p><code>id</code> is of type <code>Guid</code>, and <code>tab</code> is of type <code>int</code>.</p>
  <p>How can I configure my routing to eliminate the <code>id</code>-part (<code>/0</code>) in the following url to a view which does not make use of it?</p>
  <pre><code>/Home/Index/0/3 // id is not relevant, tab = 3
  </code></pre>
  <p>In this case, I have to set <code>id</code> to <code>0</code> in order for the url to work. This is an index-view with sub sections organized in tabs.</p>