Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess and protecting my bandwidth.

Status
Not open for further replies.

compxinu

MIS
Joined
Sep 20, 2004
Messages
40
Location
US
I currently have a .htaccess file in my /images directory with the following code in it:

--------.htaccess.php------------

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteRule .(gif|jpg|bmp)$


The goal is to keep image thieves from linking to my images and using up my bandwidth.

The RewriteRule will point them to an image that reads a nasty note..

Recap:
.htaccess.php is in my image directory, in hopes of protecting all the images.

But when I test it by going to one of my other sites and linking an image from my original site, I can still link the image with no problem. I have rebooted my webserver also, and still no luck..

All help is appreciated..
 
Did you AllowOverride in the main httpd config?
 
Yes, Allow Override in the main httpd config file is good to go.

Any other ideas on what I could be doing wrong?

Thanks..
 
Okay,

Here is my .htaccess file again, but modified..


RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteRule \.(jpg|JPG|gif|GIF|bmp|BMP)$ [R]


I have followed all thestep (well, I think I have) that the apache forums say to do. But I am confused as to why this doesn't work when I test.

I have another site on the same server, and testing via that site. Meaning, I am linking an image from mysite1.com to mysite2.com and I can still see the image that I am stealing from mysite1.com.. Make sense?

I have restarted apache everytime I made a change, and still no luck..

Please help..
 
Try enabling the rewrite log. The first thing it will tell you is if the rewriting is even taking place. If it is, then you will have more information to debug with.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top