title: RedirectToAction is changing the URL
body: <p>My call to <code>RedirectToAction</code> is acting like <code>RedirectToActionPermanent</code>. That is, the URL is being changed, rather than simply displaying a different view.</p>
  
  <blockquote>
    <p><strong>Edit</strong>: Now that I think about it, <code>RedirectToAction</code> <em>typically</em> acts as a permanent redirect. As in, this is probably the correct behavior. In the below code, if the <code>ModelState</code> is valid, the user is given a 302 redirect back to the index. But then, what's the point of <code>RedirectToActionPermanent</code>?</p>
  </blockquote>
  
  <p>The redirects are for HTTP errors. I have my Web.config set to point errors to certain action methods in <code>HttpErrorsController</code>. This works perfectly, including showing a temporary redirect, as expected. (<code>https://localhost/ThisPageDoesntExist</code> shows error page but the URL remains the same)<br>
  Returning an <code>HttpStatusCodeResult</code> or throwing an <code>HttpException</code> both work as expected.</p>
  
  <p>However, if I try to do a temporary redirect to an error action method by using <code>RedirectToAction</code>, the view is still displayed properly, but the URL changes, e.g. <code>https://localhost/HttpErrors/404</code>.</p>
  
  <p>HttpErrorsController.cs</p>
  
  <pre><code>private ViewResult ErrorView(HttpStatusCode httpStatusCode, string shortDesc, string longDesc)
  {
      Response.StatusCode = (int)httpStatusCode;
      return View("HttpError", new HttpErrorViewModel(httpStatusCode, shortDesc, longDesc));
  }
  [ActionName("404")]
  public ActionResult Error404()
  {
      return ErrorView(HttpStatusCode.NotFound, "Not Found",
          "The requested resource could not be found.");
  }
  // Other identical methods for each error
  </code></pre>
  
  <p>ItemController.cs</p>
  
  <pre><code>public ActionResult HttpError(HttpStatusCode status)
  {
      return RedirectToAction(((int)status).ToString(), "HttpErrors");
  }
  [HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Create(ItemViewModel viewModel)
  {
      if (!Request.IsAjaxRequest())
      {
          return HttpError(HttpStatusCode.NotAcceptable);
      }
      if (ModelState.IsValid)
      {
          db.Items.Add(pm);
          db.SaveChanges();
          return RedirectToAction("Index");
      }
  
      return PartialView("_Create", viewModel);
  }
  </code></pre>
  
  <p>Since writing the above, I've realized I'm probably better off just throwing an <code>HttpException</code>, so that it also gets caught by ELMAH, but I'm still quite confused by the behavior described above.</p>