title: Redirect in php throws 520 error CloudFlare
body: <p>I am using cloudflare with codeigniter framework and I am facing strange problem while trying to redirect the script to another page when the action is completed, server use to throw error 520(cloudflare server)</p>
  
  <pre><code>$input = $this-&gt;input-&gt;post();
  
  if(!empty($input)){
  
          $this-&gt;load-&gt;library('form_validation');
  
          $this-&gt;form_validation-&gt;set_rules('email', 'Email', 'required|email');
          $this-&gt;form_validation-&gt;set_rules('password', 'Password', 'required');
  
          if ($this-&gt;form_validation-&gt;run() == TRUE)
          {
              $r = $this-&gt;userModel-&gt;login($input["email"], $input["password"]);
              if($r["success"] == "t"){
  
                  $this-&gt;userModel-&gt;setSession($r["_user_id"], $r["token"]);
  
                  //Both redirect methods does not works
                  //echo '&lt;html&gt;&lt;head&gt;&lt;META http-equiv="refresh" content="0;URL='.$this-&gt;glob-&gt;exec_redirect().'"&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;';
                  redirect($this-&gt;glob-&gt;exec_redirect());
                  die();
              }else{
                  $data["errors"] = $r["message"];
              }
          }else
              $data["errors"] = validation_errors();
      }
      $this-&gt;load-&gt;view("user/login", $data);
  </code></pre>
  
  <p>This script work fine without cloudflare, also the script work fine with cloudflare without redirect functions.
  Demos:</p>
  
  <p><a href="https://www.plac24.com/user/login" rel="nofollow">Sample which throws error</a></p>
  
  <p><strong>user</strong>: test</p>
  
  <p><strong>pass</strong>: test12</p>
  
  <p>Sometimes you should try more then once to crash </p>
  
  <p><a href="https://www.plac24.com/user/testlogin" rel="nofollow">Sample without redirect</a></p>
  
  <p>Works fine, user is logged in just have to redirect Manuel.</p>
  
  <p>Regards. </p>