[thelist] how to prevent hotlinking of JS files (ASP.NET)

VOLKAN ÖZÇELİK volkan.ozcelik at gmail.com
Tue May 30 13:28:15 CDT 2006


Hi listos and listettes.

It's a hot and boring summer night in Turkey. And I got bored further after
analyzing my webstats:

Some clever dude (who calls himself "pirate" on his website) is hotlinking
three of my library files (which are js files around 70K)

I manage to redirect hotlinks to my aspx files using server-side event
handlers in the global.asax.
However js files (and any other non-server-side files for that matter --
image, html, text, pdf) do not trigger any of the events in the global.asax.

If it were php, I could have used some htaccess trick. But I don't have an
idea how to do it on the .net platform.

The first solution that comes to my mind is to rename my lib files and
change the content of the hotlinked files with somehting like

library.js
...
self.location="http://example.com/Leecher.aspx";
...

However, this will turn out to be a cat and mouse game after some time.

I used google but had no luck. There are several commercial components for
this, but my hosting is not dedicated for the time being; and installing a
server-side component is not an option.

Currently it's not a big deal for me (I have a very small number of hits
from that pirate site) but I'd like to prevent it if possible.

Do you have any ideas?

TIA
-- 
Volkan Ozcelik
+>Yep! I'm blogging! : http://www.volkanozcelik.com/cre8/blog/
+> Going solo in Turkish: http://www.volkanozcelik.com/donkisot/
+> My projects/studies/trials/errors : http://www.sarmal.com/
+> Sardalya JavaScript Library: http://www.sarmal.com/sardalya/



More information about the thelist mailing list