title: $_SERVER['HTTP_HOST'] not recognized
body: <p>I have this simple statement that checks if the <code>$_SERVER['HTTP_HOST']</code> returns the same value of the variable <code>$C['ST__URL']</code>. If not it does a 301 redirect.
  Today we had a downtime because the <code>$_SERVER['HTTP_HOST']</code> did not match with the <code>$C['ST__URL']</code> variable.</p>
  
  <p>The downtime was caused by a forced 301 redirect falling into a continuous loop, so the reason must be the <code>$_SERVER['HTTP_HOST']</code> not been recognized. </p>
  
  <p>The <code>$C['ST__URL']</code> was correctly filled, so I am wondering which can be the cause of the downtime? An Apache temporary issue? A different configuration in the DNS zone?</p>
  
  <pre><code>$url = parse_url($C['ST__URL']);
  
      if($_SERVER['HTTP_HOST']!=$url['host']) {
          header('HTTP/1.1 301 Moved Permanently');
          header('Location: '.$C['ST__URL'].$_SERVER['REQUEST_URI']);
      }
  </code></pre>