OK I am revising my original question as now it has boiled down to a specific problem.

I need to set my server to block requests coming to /loc* (loc1, loc2 .. locn) folder on the root.

Is this possible? (I cannot find any other way around this as the requests are coming from random IP addresses and going for different folders that all start with /loc)

Old post below: -----------------

I am getting these image requests to my live site. Hundreds of them every few minutes..

Who and why would do this and what should be the steps to take to deal with it. They seem harmless if I am not missing the point but they are flooding my log files..


The controller for path '/loc295/th_21e_shower052.jpg' could not be found or it does not implement IController.

The controller for path '/loc171/th_251_shower014.jpg' could not be found or it does not implement IController.

migrated from stackoverflow.com Nov 12 '09 at 21:08

This question came from our site for professional and enthusiast programmers.

  • 1
    Who - check the IP address in your logs. Why - ask the owner of the IP. – Darin Dimitrov Nov 12 '09 at 21:03

I've had similar things happen to me where my ip was a former mp3 site.

What I ended up doing was to redirect them to an empty file. I'd recommend for you just to server a 0x0.jpg file using an alias system of some sort.


sounds like porn malware mistakenly trying to get images from your server. Perhaps set your webserver to ignore any request of the form */loc[number]/*?

  • How can i set this? – user18815 Nov 12 '09 at 21:41

Was there an image at that location that you removed? Otherwise my only guess would be that someone misspelled their image domain and accidentally is trying to request that image from you. The image might be being requested from a high traffic place like a forum signature or something like that

To remedy this you could ban the IP that is requesting the image, but I don't know that this would stop the flood of logging.


I had something similar on my local web server. It turned out to be microsoft media player - it was searching on localhost for various album covers. Make sure nothing else on the box is referencing localhost.


One possibility is that someone was attempting to "image leech" or "hotlink" but entered the wrong URL. The broken image may have been posted on a popular forum somewhere perhaps. It is possible to prevent this through some fancy IIS server configuration.

Another suggestion to partially alleviate some of these requests is to use content expiration. This won't solve the problem, but it can in some cases drastically cut down the number of HTTP requests and it's often a good thing to do anyway. I like to set the expiration to 1 hour for images, css, and js files. This will tell the browser to cache the image for an hour and the browser won't even ask the server if it's been updated until that hour is up.


I think that anyone running a public webserver just needs to get used to this kind of garbage in the logs, and find a good tool to parse them.

There could be many reasons for this occuring, from the unintentional (mentioned in other posts - ie. mistyped url - re-used IP address), to those probing for vulnerabilities in your server.

I tend to think most of it is the latter.


If you're using IIS7 then use URL Rewrite. You can use a simple wildcard compare or regex to block the specific folders that you want and you can edit them easily over time.

If you're using IIS6, then consider ISAPI Rewrite.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.