'Tis the reason to ALWAYS disallow framing of your site [UPDATED]

The Digg Man helpfully points you in the direction of the DiggBar

Not that a lot of sites get "digged", but this is a practice that was all the rage among Russian pornographerabout 5 years ago. They would frame blogs with great search rank like, ahh ... hmmmm ... culturektichen, in order to steal their "google juice".

Why oh why is Digg jumping on that bandwagon now? From Just Say No to Digg's DiggBar:

But let's explore the idea that Digg is just lying.

Think about it for a moment. You invest countless hours promoting your content. You get lucky enough to make the homepage of Digg, or you hit the Retweet motherload on Twitter. A certain percentage of all those people who see your content are going to copy & paste the link they land on into a blog post. (Thereby generating a link for your site).

Before the DiggBar, (and with legit shortening services) all those links would point to your url. Now, a large percentage of them are going to be links pointing to a page on Digg. Now if you are Yahoo, CNN, or the BBC, that isn't really going to matter much. You don't have to spend time thinking about building link equity, because you already have it. However, if you are a newer site struggling to build trusted link equity in the current black hole environment we live in, the mass adoption of the DiggBar is a serious issue.

I will be advising all clients to add some frame busting code to their sites so the DiggBar won't work for the simple reason that regarless which scenario is accurate, they are both equally wrong.

I've always made it a point to frame busting code on my site to make it impossible for other people to frame my site into theirs and steal my content wholesale --and I do the same for all the sites I develop.

And how do you do it?

Add the following script right before <HEAD> in all your blog templates:

<script type="text/javascript">
if(top.location != location) {
top.location.href = document.location.href;
}
</script>

UPDATE: John Gruber over at Daring Fireball has a way to block framing with PHP scripting:

Most pages on DF are served through PHP, so I added a short bit of PHP near the top that looks like this:

<?php
if (preg_match('#http://digg.com/\w{1,8}/?$#',
                           
$_SERVER['HTTP_REFERER']) ) {
    echo
"<p>Special message for Digg users here.</p>";
    exit;
}
?>

The first line uses a regular expression to check if the HTTP referrer looks like a DiggBar URL, which, for my purposes, I’ve defined as “digg.com/” followed by exactly 1-8 letters or numbers and an optional trailing slash. It doesn’t attempt to block all referring URLs from Digg, just those that look like DiggBar pages. If the pattern matches, it prints a special message for Digg users and calls PHP’s standard exit function, which stops the rest of the page from being transmitted.

Some sites use JavaScript to completely block framing; I don’t want to do that, and, given DF’s configuration, it was easier for me to use PHP to target Digg specifically.

Am torn now because with my sites, I've had the Russian pornographer problem for years, so I have to disallow ALL framing. Will experiment with both techniques and report later.

http://culturekitchen.com/liza/blog/039tis_the_reason_to_always_disallow_framing_of_your_site
Mouse over the text to select it, then press Ctrl-C to copy it.
No votes yet
About author

Liza Sabater is the founding blogger and publisher of culturekitchen and Daily Gotham. She also a new media producer and social technologist with 10 years experience. You can reach her at blogdiva [at] culturekitchen.com or follow her on Twitter at http://twitter.com/blogdiva

liza's picture



Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • You may link to webpages through the weblinks registry
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Flash node macros can be added to this post.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].
  • You may use [inline:xx] tags to display uploaded files or images inline.
  • Images can be added to this post.
  • Easily link to terms in various wikis. For help, see <a href="/interwiki/1">interwiki</a>.
  • Links to specified hosts will have a rel="nofollow" added to them.

  • You may post PHP code. You should include <?php ?> tags.
  • You may use <swf file="song.mp3"> to display Flash files inline
  • Textual smileys will be replaced with graphical ones.
  • Web page addresses and e-mail addresses turn into links automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

User login

The Publisher
Liza Sabater

Daily servings of political dissent
culturekitchen

Grassroots News and
Activism for New Yorkers

Daily Gotham

Feminist Bloggers
Network

BlogSheroes

A new kind of vouyerism
Voogling

Art + Code + Philosophy
Potatoland.blog

Got any dirt, tips, leads or money for us? Then drop us a line or two at editors [at] culturekitchen [dot] com or use our general contact form to reach everybody in the editorial team ASAP.

Nibble daily on our brainy goodness with our daily syndication digest. You'll receive an email with a list and links to the previous day's posts.



Powered by FeedBlitz

Upcoming events

  • No upcoming events available

QUOTES

"People say, 'She's so successful' and 'Look at her position as a black woman.' She is a black woman who grew up in Birmingham, Ala., and said that she never experienced a day of racism in her life," Lee tells the April issue of Stuff magazine.

"Condi, stop smoking that crack!"

"I know you love your Ferragamo shoes, but come on. While people were drowning in New Orleans, she was going up and down Madison Ave. buying Ferragamo shoes. Then she went to see 'Spamalot.'"

— Spike Lee

Poll