title: PHP 410 redirect
body: <p>I'm using WordPress and I would to redirect all unauthorized users to the homepage.</p>
  
  <p>In order to do so in the header file I put (at the begin of the file) the following PHP code:</p>
  
  <pre><code>if (bp_current_component() != "" 
      &amp;&amp; bp_current_component() != "event" 
      &amp;&amp; !is_user_logged_in() 
      &amp;&amp; !isset($_COOKIE[affiplus]) 
      &amp;&amp; !isset($_GET[affid]))
  {
      header( "HTTP/1.1 410 Gone" ); 
      header( "Location: ".get_option('siteurl')."/home/");
  }
  </code></pre>
  
  <p>Unfortunately the HTTP error code returned is always 302 (Moved permanently) and not 410 as I want. Why?</p>