catalyst2 community forums  

Go Back   catalyst2 community forums > Support > Scripting Support

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 06-08-2006, 09:47 PM   #1 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 8
Preventing hotlinking with IIS

Hi,

New to IIS so please forgive me if this is an idiotic question.

How do I prevent hotlinking to images with IIS. With my apache host it's just a case of editing the .htaccess file. Is there an easily configurable way of doing the same thing?

I'd like to basically have a white list of sites I'd allow to hotlink, and block everybody else.

I have tried scripting my own httphandler in asp.net, but it seems that IIS will serve up image files quite happily and my handler never gets hit. I added the following to web.config, and obviously provided a class to do the work:

<httpHandlers>
<add verb="GET,HEAD" path="*.jpg" type="SlippyPixel.CheckAuth,SlippyPixel"/>
</httpHandlers>

I have also tried adding the code in the Session_Start event in global.asax, but again, this code never get's hit when a request for an image comes in, only requests for aspx and misc other files.

Am I missing something obvious? Is there a way of doing this without having to request catalyst2 to mess with IIS? Will catalyst even do the necessary IIS ISAPI messing if requested? Has anybody else successfully managed to stop hotlinking to image files? Will there ever be peace on earth?

Any help or advice would certainly be appreciated!

Cheers
slippypixel is offline   Reply With Quote
Old 07-08-2006, 11:24 AM   #2 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 8
OK, so after some digging in google. It appears that I just need to ask catalyst2 to configure extension mappings for .jpeg .jpg and .gif files to point to the ASP.NET ISAPI on my site dir in IIS.

The custom httphandlers then work fine (I've tested with my local copy of IIS).

Is that something I should just raise a ticket for?
slippypixel is offline   Reply With Quote
Old 07-08-2006, 05:38 PM   #3 (permalink)
Bring me your problems :p
 
paulredpath's Avatar
 
Join Date: Jan 2003
Location: /dev/ahhhhhhhhh
Posts: 3,537
If you raise a ticket we have no problem doing that for one domain.
paulredpath is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:07 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.