Detect is site opened in iframe and redirect : <p>there is a web app. It suppouse to be avilable only in specific iframe (corp. site), so uninvited guests are redirect to clients web site by script. 
Code below is working, but java could be disable in browser. IP white list would be a great solution, but too many dynamic IP is used.</p>

<p>What php trick can be used to check is site opened in iframe?</p>

<pre><code>&lt;script&gt;
                if (top === self) window.location.replace('http://uninvited-guests-go.here'); 
&lt;/script&gt;
&lt;?php header('X-Frame-Options: ALLOW-FROM https://iframe.allow.only'); ?&gt; 
</code></pre>
