homepage Welcome to WebmasterWorld Guest from 54.161.220.160
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
htaccess preventing other web sites from poaching images from my site
Need to restrict live links to my images from my web site only
artminds

10+ Year Member



 
Msg#: 437 posted 10:47 pm on Oct 27, 2001 (gmt 0)

I am having difficulty with correct syntax to restrict others from live linking to images on my web site. My web site is hosted at Earthlink, on one of their virtual domain servers. However, they tell me that I should be able to use my URL as the "allow" referrer. I have done that, but it also restricts the images or pages from being displayed from pages on my web site. If I click a link to a html page in the restricted directory, I get a HTTP 500 Internal Server error page. This is the COMPLETE .htaccess file I am using in the restricted directory:

AuthUserFile /dev/null
AuthGroupFile /dev/null

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/test/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/test/
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/cgi/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/cgi/
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/cards/1/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/cards/1/
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/cards/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/cards/
RewriteCond %{HTTP_REFERER} !^http://mydomain.net/cards/1/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.net/cards/1/
RewriteCond %{HTTP_REFERER} !^http://mydomain.net/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.net/
RewriteCond %{HTTP_REFERER} !^http://mydomain.net/cards/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.net/cards/
RewriteCond %{HTTP_REFERER} !^http://mydomain.org/cards/1/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.org/cards/1/
RewriteCond %{HTTP_REFERER} !^http://mydomain.org/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.org/
RewriteCond %{HTTP_REFERER} !^http://mydomain.org/cards/
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.org/cards/

RewriteRule /* [mydomain.com...] [R,L]

Can anyone help?

(edited by: DaveAtIFG at 1:04 am (gmt) on Oct. 28, 2001)

 

sarkye

10+ Year Member



 
Msg#: 437 posted 10:52 pm on Oct 27, 2001 (gmt 0)

Create an .htaccess file *within* your images directory like this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://yourdomain/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain/.*$ [NC]
RewriteRule .*\.gif$ - [G]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://yourdomain/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain/.*$ [NC]
RewriteRule .*\.jpg$ - [G]

artminds

10+ Year Member



 
Msg#: 437 posted 10:59 pm on Oct 27, 2001 (gmt 0)

I've tried that, and still the images don't display when I'm calling them from a page within MY web site!
Any suggestions?

Jaxom

10+ Year Member



 
Msg#: 437 posted 4:57 pm on Nov 9, 2001 (gmt 0)

People who link to your images are stealing not only the images but your bandwidth as well. If it is possible to change the image names, that could be a path to take. I read of a site that did solved this problem quite well. The owners of the site had notices requesting folks not to directly link to the site's images. They had contacted those who did, and got tired of the situation. They noticed one site boasting of an upcoming event, and on the day of the new event altered the images. Porn banner ads replaced what the pilferer thought was on his site. Perhaps a little mean spirited, but the owner of the site, where the images were being stolen, had requested people stop and had even made sure he notified the "event" site. Not only that but it spread stories, such as this, which can be used to help educate others as to why live linking is not a good practice...and the actions that might result from doing so.

ggrot

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 437 posted 5:30 pm on Nov 9, 2001 (gmt 0)

I remember it was xoom.com I believe who replaced all stolen images dynamically with little ads for their service. Since they hosted other people's files, it was needed pretty often.

artminds, did you make sure to replace yourdomain in the .htaccess file in all 4 places? Also make sure you include the .com/.net/.org/.* in there too.

artminds

10+ Year Member



 
Msg#: 437 posted 10:07 pm on Nov 9, 2001 (gmt 0)

Thanks for all the comments. I found out that Earthlink, on their shared servers, does not make the REWRITE command available, so including that in the .htaccess file only generates an HTTP 500 Internal Server error. I have to find another web hosting company that will enable the kind of features I need.
Thanks again.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved