2

My website keeps getting hijacked by searchportal.information it looks like they are using an iframe script to do it. here is the script (link doesn't work anymore):

how do I prevent them from including my site/content on an iframe on their site?

migrated from stackoverflow.com Mar 4 '11 at 4:04

This question came from our site for professional and enthusiast programmers.

7

Use a frame breaker script:

<script type="javascript">
        if(location.href!=top.location.href){ 

            top.location.href=location.href
        } 
</script>
3

One of the best ways to prevent framing, is to use a rule on your .htaccess, like so

<IfModule mod_headers.c>
        Header always append X-Frame-Options SAMEORIGIN
</IfModule>

This method doesn't rely on JavaScrpit being active or not but on the support of the X-Frame-Options header. It is not an Internet Standard, but it is quite well supported as of February 2014

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy