Recently, I found that one of my popular sites is shown as part of other site. So visitors of that not-mine site, being on that site, can access all the services of my sites. They used my site content and services via iframe and took benefits from my site.
Below is the solution how to prevent this, i.e. block showing your site content via iframe. The solution is pretty simple.
Put this javascript code on all your pages:
[codesyntax lang=”javascript”]
<script>if(self != top) { top.location = self.location; }</script>
[/codesyntax]
If one site will show your site in iframe, it will redirect the browser to your site directlty, so that user will will your site in browser as it is.
Ok says:
thank you
gobind says:
how can i opne facebook in iframe