title: Changing the default landing page in ASP.NET Core Razor page?
body: <p>I tried:</p>
  
  <pre><code>services.AddMvc().AddRazorPagesOptions(options =&gt;
  {
      options.Conventions.AddPageRoute("/Index", "old");
      options.Conventions.AddPageRoute("/NewIndex", "");
  }).SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
  </code></pre>
  
  <p>This exception is thrown:</p>
  
  <blockquote>
    <p>AmbiguousMatchException: The request matched multiple endpoints.
    Matches: </p>
    
    <p>Page: /Index </p>
    
    <p>Page: /NewIndex</p>
  </blockquote>
  
  <p>I found <a href="https://stackoverflow.com/a/51391725/6197785">this</a>, that suggests renaming the Index page, but it obviously, if not a good reason presented, is a workaround. Can't I just change the default page without renaming the /Index page?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The suggested SO threads don't cover the problem I explained, which is overriding the default route without having to rename the default <code>Index</code> page.
  The accepted answer solved the problem.</p>