Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

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

2 Answers

Use a frame breaker script:

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

            top.location.href=location.href
        } 
</script>
share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.