title: Fix a redirect loop?
body: <p>I have the following code in my index.php page:</p>
  
  <pre><code> &lt;?php include("/includes/widgets.php") ?&gt;
  </code></pre>
  
  <p>And in my widgets.php page:</p>
  
  <pre><code>&lt;?php
       header("Location: /");
  ?&gt;
  </code></pre>
  
  <p>What I want to achieve with this is to redirect it if the user visits it, but allow it for including.</p>
  
  <p>But I get the following error:</p>
  
  <blockquote>
    <p>The webpage has a redirect loop</p>
  </blockquote>
  
  <p>How can I fix/prevent the redirect loop, but still redirect the user and not the server.</p>