ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Content theft through iframe

July 19, 2008 1:16am

Subscribe [3]
  • #1 / Jul 19, 2008 1:16am

    soxhead

    69 posts

    I found a site that is iframing my site into their site wrapper, which is pretty annoying.

    I’ve contacted the site about it, but I don’t know what sort of action they’ll take.

    Anyone know if there’s a way to prevent that from happening, either through htaccess or some setting in EE?

    If possible, I’d like to be able to detect that this is happening, and redirect the iframed content to a different page with a big middle finger on it.

  • #2 / Jul 19, 2008 3:36am

    George Ornbo

    272 posts

    Bummer!

    Use .htaccess

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} theleechingwebsite\.com [NC]
    RewriteRule \.(gif|jpg|png)$ <a href="http://www.yoursite.com/anotherimage.jpg">http://www.yoursite.com/anotherimage.jpg</a> [R,L]

    You can get quite sophisticated on what is served to that site for each file but you’ll need to know your way around mod_rewrite.

  • #3 / Jul 19, 2008 12:51pm

    soxhead

    69 posts

    Thanks, George.

    I also found another method that’s working pretty well. I just added this javascript to my header template to break any iframing & redirect to my site:

    if (parent.frames.length > 0)
    {
    parent.location.href = location.href;
    }

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases