How to reject outside links to image or .rar resourses on my site?

P

pepwelcome

I tried httpMoudle, and it seems it worked under VS.net 2005, but
failed when I tried "http://localhost/", but I think an HTTP request
for an image on my server is not processed by asp.net but is responsed
directly by iis itself. What shall I do?
=============
What I have done:
I wrote a rf.vb and compiled it to rf.dll and copied it to the /bin/
directory.
in the rf.vb file i intercepted any request and just
response.write("OK!")
Under VS.net 2005 environment it really works: whatever file I request,
I just get an "OK".
But when I closed vs.net 2005 and tried to input
"http://localhost/a.jpg", the image showed!!!!
What shall I do????
 
K

Kevin Spencer

All requests for images and, indeed, any other files on your site, come from
a client outside the site.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 
O

Otis Mukinfus

I tried httpMoudle, and it seems it worked under VS.net 2005, but
failed when I tried "http://localhost/", but I think an HTTP request
for an image on my server is not processed by asp.net but is responsed
directly by iis itself. What shall I do?
=============
What I have done:
I wrote a rf.vb and compiled it to rf.dll and copied it to the /bin/
directory.
in the rf.vb file i intercepted any request and just
response.write("OK!")
Under VS.net 2005 environment it really works: whatever file I request,
I just get an "OK".
But when I closed vs.net 2005 and tried to input
"http://localhost/a.jpg", the image showed!!!!
What shall I do????
I am working on the same issue. I'm getting closer :eek:) by trying to trap the
URL of the host in global.aspx.cs, but have a way to go yet.

In my case I want to trap specific Hosts and redirect them to another web site
that describes copyright law ;o)

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
E

Erik Funkenbusch

I tried httpMoudle, and it seems it worked under VS.net 2005, but
failed when I tried "http://localhost/", but I think an HTTP request
for an image on my server is not processed by asp.net but is responsed
directly by iis itself. What shall I do?

This is correct. One possible solution, which I don't like very much, is
to map asp.net to handle the image files you are requesting, then your
handler will work. (I assume that the DevEnv web server handles all
requests, even images, through isapi_aspnet.dll, while IIS does not by
default).

Another option is to write your own ISAPI module, but you can't easily do
this in managed code. You'll have to drop back to C/C++ to handle it.

Finally, there are several third party ISAPI filters already on the market
to handle this, you might find it more cost effective to purchase one of
these.
 
P

pepwelcome

to: Erik Funkenbusch,

Yea, I AM using a third-party ISAPA named ISAPA_rewrite, but do you
think it is more efficient for ISAPA_rewrite to deal with this problem
or we write our own code with httpMolule?

Anyway, maybe performance drawback is what we have to suffer when we
try to protect our website.

Thanks to all guys above!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top