Tell HN: How to ban url shorteners from linking to your site

https://news.ycombinator.com/item?id=713770
by pj • 17 years ago
22 42 17 years ago

This is just an idea I'm going to throw out there. It seems a bit odd to suggest it because any link is a good link, right? Maybe not.

Anyway, something like this in a bit of javascript would prevent people from linking to your site using a url shortener:

  <script>
  if (document.referrer.indexOf('bit.ly') > 0 
    || document.referrer.indexOf('someothershortener')>0)
   document.location.href='http://yoursite.com/noshortener.html';
  </script>
Put in that noshortener.html some content that will tell people why you don't allow shorteners to your content, here are some suggestions:
  1) You want to know where your visitors are coming 
  from and shorteners steal the real referrer.
  2) Shorteners are a layer of indirection that could 
  be modified beyond the user of the shortener's 
  discretion to do something like digg is doing now
  3) If the shortener goes away, the link to the 
  content is no longer valid
  4) It slows down the web due to one more DNS lookup, 
  one more server redirect, etc...
Most users of shorteners, when they use one to link to a site are going to click the link just to make sure it works. When they do, they'll see your banned url shorteners page and it will help all of us "experts" in the web who understand why url shorteners are bad educate the lay users of the web as to why those url shorteners are bad.

Yes, we take a hit, but we are sacrificing a little traffic for a better web experience in the future.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com