Click to See Complete Forum and Search --> : Block / Deflect access with .htaccess


ares
04-04-2003, 09:48 AM
Hi!

I offer an download on my webpage an sice a few days an other page refers to that download.

Those downloads causes a lot of undesirable traffic on my page.

Now I want to block the accesses from that page.
I fount an discription how to do that at http://httpd.apache.org/docs/misc/rewriteguide.html

-------------------------------------------------

.HTACCESS:
==========

RewriteMap deflector txt:deflector.map

RewriteCond %{HTTP_REFERER} !=""
RewriteCond ${deflector:%{HTTP_REFERER}} ^-$
RewriteRule ^.* %{HTTP_REFERER} [R,L]

RewriteCond %{HTTP_REFERER} !=""
RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND
RewriteRule ^.* ${deflector:%{HTTP_REFERER}} [R,L]

DEFLECTOR.MAP
=============

##
## deflector.map
##

http://www.badguys.com/bad/index.html -
http://www.badguys.com/bad/index2.html -
http://www.badguys.com/bad/index3.html http://somewhere.com/
-------------------------------------------------


So far so good. But when I insert the first part into the .htaccess and creat the deflector.map in the same directoy on the server it is no longer possible access my webpage (for nobody).

Everything I achived with that is getting an Error 500.

When I delete the first line of the .htaccesse (RewriteMap deflector txt:deflector.map) the error does not longer occure but the page is unprotected, too...

So what have I do to, to protect my webseite from those downloads?

Any idea?

Thank you very much
Stefan