Hotlinking

Having a problem with a client's site and foreign stations hotlinking to their image files. This is hosted on a Windows server and I tried using a web.config file to stop it. I found out after many tries that the code would not work on Server 2003 so I moved the site to where it would be on Server 2008. This morning the site came up after going through DNS prop and I uploaded the web.config file with the hotlinking code it it. Site worked great, the code worked as I went to the offender's site and none of the images previously displayed were showing.

About seven hours later I checked on the site and received a 500 error which was odd since no one had changed anything. I deleted the web.config file that worked previously and the site came up. If I put the web.config file back online it caused 500 error. The strange part is that I uploaded this same web.config file this morning and everything worked. The site was up and the offender blocked. Now I can't seem to block these three sites from hotlinking and have wasted hours moving the site to a newer server which doesn't seem to help.


Here is the code for the web.config file that was operational this morning:


<configuration>
<system.webServer>
<rewrite>
<rule name="Prevent hotlinking">
<match url=".*\.(jpg|jpeg|png|gif|bmp)$"/>
<conditions>
<add input="{HTTP_REFERER}" pattern="^$" negate="true" />
<add input="{HTTP_REFERER}" pattern="^http://DOMAINREMOVED\.com/.*$" negate="true" />
</conditions>
<action type="Rewrite" url="/images/hotlinker.jpg" appendQueryString="false" />
</rule>
</rewrite>
</system.webServer>


Is this code correct or am I unable to stop these leeches? The reason it is important to block these sites is that the client's site has take a bit of a hit from Google because of bad neighborhood issues. These bad neighborhoods just so happen to be the hotlinkers. Sure I can just change the folder name and and reup the files but it will be a matter of time before they adjust their bots.

Any and all help would be appreciated.
 
Hello,

Please send me a private message with the domain in question, also make sure the web.config you are trying to use is there among the files like web.noetworkingconfig or something like this that I can tell is the file, and I will give it a check. I'm a bit under weather at moment with a pretty bad sinus infection but I will check it and be sure techs know as well once found the issue.
 
Hello,

Please send me a private message with the domain in question, also make sure the web.config you are trying to use is there among the files like web.noetworkingconfig or something like this that I can tell is the file, and I will give it a check. I'm a bit under weather at moment with a pretty bad sinus infection but I will check it and be sure techs know as well once found the issue.


Hope you are feeling better, support found the problem was that web.config would not work with accounts on Server 2003 so I took site down and moved it onto a Server 2008 account and now it works (web.config with some tweaks courtesy of Jodo support).
 
ok great :)

Healthwise, much better thanks!

I am feeling a bit stressed from things like MSSQL12 today and messing with some important plans, but such is life I guess.
 
Back
Top