title: Use 301 or 303 to redirect http to https
body: <p>I'm not sure which is the best to use for my site when redirecting from http to https. 
  At the moment I am using IIS rewrite rules to do the redirect. The guides I've read on how to do this use either a 301 or a 303. And after reading up on 301 and 303, I'm still not sure which is best to use.</p>
  
  <p>My understanding is they are pretty much similar in what they do in regards to a redirect between http and https.</p>
  
  <p>Is there any difference and will it affect SEO in any way using one over the other?</p>
  
  <p>From the spec:
  301</p>
  
  <blockquote>
    <p>The 301 (Moved Permanently) status code indicates that the target<br>
    resource has been assigned a new permanent URI and any future<br>
    references to this resource ought to use one of the enclosed URIs.<br>
    Clients with link-editing capabilities ought to automatically re-link 
    references to the effective request URI to one or more of the new<br>
    references sent by the server, where possible.</p>
    
    <p>The server SHOULD generate a Location header field in the response 
    containing a preferred URI reference for the new permanent URI.  The<br>
    user agent MAY use the Location field value for automatic<br>
    redirection.  The server's response payload usually contains a short<br>
    hypertext note with a hyperlink to the new URI(s).</p>
  
  <pre><code>  Note: For historical reasons, a user agent MAY change the request
    method from POST to GET for the subsequent request.  If this
    behavior is undesired, the 307 (Temporary Redirect) status code
    can be used instead.
  </code></pre>
    
    <p>A 301 response is cacheable by default; i.e., unless otherwise<br>
    indicated by the method definition or explicit cache controls</p>
  </blockquote>
  
  <p>303</p>
  
  <blockquote>
    <p>The 303 (See Other) status code indicates that the server is<br>
    redirecting the user agent to a different resource, as indicated by a 
    URI in the Location header field, which is intended to provide an<br>
    indirect response to the original request.  A user agent can perform<br>
    a retrieval request targeting that URI (a GET or HEAD request if<br>
    using HTTP), which might also be redirected, and present the eventual 
    result as an answer to the original request.  Note that the new URI<br>
    in the Location header field is not considered equivalent to the<br>
    effective request URI.</p>
    
    <p>This status code is applicable to any HTTP method.  It is primarily
    used to allow the output of a POST action to redirect the user agent<br>
    to a selected resource, since doing so provides the information<br>
    corresponding to the POST response in a form that can be separately<br>
    identified, bookmarked, and cached, independent of the original<br>
    request.</p>
    
    <p>A 303 response to a GET request indicates that the origin server
    does    not have a representation of the target resource that can be<br>
    transferred by the server over HTTP.  However, the Location field<br>
    value refers to a resource that is descriptive of the target<br>
    resource, such that making a retrieval request on that other resource 
    might result in a representation that is useful to recipients without 
    implying that it represents the original target resource.  Note that<br>
    answers to the questions of what can be represented, what<br>
    representations are adequate, and what might be a useful description<br>
    are outside the scope of HTTP.</p>
    
    <p>Except for responses to a HEAD request, the representation of a 303
    response ought to contain a short hypertext note with a hyperlink to<br>
    the same URI reference provided in the Location header field.</p>
  </blockquote>