Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 4th, 2000, 12:32 PM
Mystic Ocelot Mystic Ocelot is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Jenks, Oklahoma, United States
Posts: 7 Mystic Ocelot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Mystic Ocelot
I'm trying to use the .htaccess file to protect the directory I use for all of my images on my site. It allows only sites that I specify within it to link off of graphics from my site. The code is as follows:

# Rewrite Rule for images
RewriteCond %{HTTP_REFERER} http://www.htmletc.net/
RewriteRule ^(.*)$ http://www.htmletc.net/

For example. And when linked off of other sites that I do not specify within .htaccess it works great, not allowing the image that is linked off my site to be shown on the other site. When I view my main site w/ Netscape (my main site is specified to allow to link off of the images), everything is great. But when I view it w/ IE, none of images appear. Any ideas or help would be greatly appreciated.

Reply With Quote
  #2  
Old September 4th, 2000, 03:13 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Have you tried -> http://www.apache.org/docs/misc/rewriteguide.html ?


Per your example, I would do something like this:


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.htmletc.net/.*$ [NC]
RewriteRule .*.gif$ - [F]
RewriteRule .*.jpe?g$ - [F]

I don't see your RewriteRule trying to block anything without the [F].

[This message has been edited by freebsd (edited September 04, 2000).]

Reply With Quote
  #3  
Old September 4th, 2000, 05:30 PM
Mystic Ocelot Mystic Ocelot is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Jenks, Oklahoma, United States
Posts: 7 Mystic Ocelot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Mystic Ocelot
Thanks, I'll look at that and put it into effect to see if I can get it to work correctly. You're help is much appreciated.




Reply With Quote
  #4  
Old September 22nd, 2000, 03:23 PM
plarkin plarkin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 3 plarkin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried editing this code and using it myself. I have a serious problem of people pirating media clips on my site. It adds a lot of traffic from which other sites get the visitors.

Do I just put it into my media folder in an .htaccess file? In the above example, I just put my url in and dropped the htaccess file in my images dir. I was able to continue pirating stuff.

Anything to add for a desperate person?

Reply With Quote
  #5  
Old September 23rd, 2000, 05:29 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Put that .htaccess in your media directory to avoid unneccessary server load. If you place it in your docroot dir, the .htaccess file will be read for any requests of your site.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > .htaccess help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT