title: ASP.NET: After returning RedirectResult, URL does not update in browser when https is in use
body: <p>I'm confused about the behavior of RedirectResult - in some cases (with https), the redirect doesn't seem to happen, but something more like a transfer.</p>
  
  <p>If a user tries to access an internal page without being logged in, they are directed to the login page. After logging in, they're directed back to my app, with query string parameter</p>
  
  <pre><code>schema://host:port/myApp?returnUrl=Inspections.mvc/Edit/43523
  </code></pre>
  
  <p>The code in the HomeController that handles this looks for the redirectUrl, and does this:</p>
  
  <pre><code>        if (returnUrl != null)
          {
              return Redirect(returnUrl);                
          }
  </code></pre>
  
  <p>In my dev environment and one QA environment, I see that a redirect response goes back to the browser, which makes another request, as expected.</p>
  
  <p>But in production and another QA environment (both of which use https), the last redirect doesn't happen. The browser continues to show the url</p>
  
  <pre><code>schema://host:port/myApp?returnUrl=Inspections.mvc/Edit/43523
  </code></pre>
  
  <p>and displays the content that would be returned by the page Inspections.mvc/Edit/43523.</p>
  
  <p>I'm perplexed - is this expected behavior when RedirectResult is used? Is https the relevant difference?</p>
  
  <p>EDIT: Checking traffic, I see that in the environments using https there IS a redirect (301- moved permanently), but it is back to exactly the same address:</p>
  
  <pre><code>schema://host:port/myApp?returnUrl=Inspections.mvc/Edit/43523
  </code></pre>
  
  <p>This additional information leaves the mystery as puzzling as ever.</p>