title: Redirect to a razor page without current route values
body: <p>I have a page, which expects some route values like this:</p>
  
  <pre><code>@page "{reportYear:int:range(2000, 2100)?}/{reportMonth:int:range(1, 12)?}"
  </code></pre>
  
  <p>A model looks like this:</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; OnGetAsync([FromRoute]int? reportYear, [FromRoute]int? reportMonth)
  {
      if (reportYear.HasValue == reportMonth.HasValue) 
      {
          MyViewModel.ReportYear = reportYear ?? DefaultReportYear;
          MyViewModel.ReportMonth = reportMonth ?? DefaultReportMonth;
          return Page();
      }
  
      return RedirectToPage(PageName);
  }
  </code></pre>
  
  <p>The idea is that if both route values specified and are correct, show the page with them.
  If both of them are not specified, still show a page but with default values.</p>
  
  <p>And if only one of them is specified, redirect to the same page, but without any route values, to show a default version and use a clear address.</p>
  
  <p>The problem is that "RedirectToPage" redirects with route values retained.
  In other words, if i visit to "/pageName/2018" i get a redirect to the same "/pageName/2018"
  The supplied route value (2018) is not getting stripped from redirect.</p>
  
  <p>How do i clear the values and redirect just to a page?</p>
  
  <p>P.S.
  Url.Page(PageName) also returnes "/pageName/2018" in this case. Route values are not getting removed.</p>
  
  <p>P.P.S.
  I just want to make a user experience a bit better.
  If a user typed an incorrect page address (i.e. "/pageName/2018"), i want to remove that incorrect part (2018) from address and a show a default page, like simple "/pageName".</p>
  
  <p>P.P.P.S.
  I know i could fiddle around with JS stuff that works with an address bar, but don't like that approach.</p>