title: How to have different x-frame-options for different pages
body: <p>I have added an X-FRAME-OPTION header to my .htaccess to prevent issues with click jacking.</p>
  
  <pre><code>&lt;IfModule mod_headers.c&gt;
      Header append X-Frame-Options "SAMEORIGIN"
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Now I am required to allow a certain route to be accessible via an iframe from outside domains. I'm using PHP and have tried overwriting the X-frame-option header via:</p>
  
  <pre><code>  header('X-Frame-Options: GOFORIT');
  </code></pre>
  
  <p>However it appears that the X-frame-option is not being overwritten but is instead being re-appended as per the following browser error (Chrome):</p>
  
  <pre><code>Multiple 'X-Frame-Options' headers with conflicting values ('GOFORIT, SAMEORIGIN') encountered when loading 'https://foo.com/baz/1'. Falling back to 'DENY'.
  </code></pre>
  
  <p>How do you go about overwriting the x-frame-options for certain pages?</p>