coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: troublemaker on November 30, 2003, 06:33:14 AM

Title: Hotlinking
Post by: troublemaker on November 30, 2003, 06:33:14 AM
QuoteI think you can drop an .htaccess file in the directory(ies) and limit which sites are allowed to hotlink off of you site.

Code:

LoadModule rewrite_module     libexec/mod_rewrite.so


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$  
RewriteCond %{HTTP_REFERER} !^http://yoursite.com/.*$      [NC]

 



In mine I have to do both http://yoursite.com and http://www.yoursite.com to work. I could be wrong but i think that would work. Also, I am also not sure at what level you would want to drop it into your site but I think it would be the root folder.
will this work? i just want to try and keep others from saveing my files easyly and hot linking
Title: Hotlinking
Post by: Oasis on November 30, 2003, 08:01:52 AM
preventing people from saving your files, no it won't help.
preventing people from hot linking, yes it will help.

Put it in the "albums" folder.
Title: Hotlinking
Post by: troublemaker on December 06, 2003, 08:18:46 PM
LoadModule rewrite_module     libexec/mod_rewrite.so


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$  
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/*.*/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.net/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.ws/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.ws/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.ws/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysiteip/.*$  
RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/index.php.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mysite.com/.*$      [NC]
with and with out the   [NC]  and get same error
error being no imagesworking on thr page in the album folder
Title: Hotlinking
Post by: Oasis on December 07, 2003, 11:35:24 AM
Here.... This is what I use:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?photo.enctu.org(/)?.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?stunion.enctu.org(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|tif|png)$ http://photo.enctu.org/noleech.jpg [R,NC]


http://photo.enctu.org/noleech.jpg is the picture that appears when they try to hotlink.

Also, make sure url rewriting is enabled on your server.
Title: Hotlinking
Post by: troublemaker on December 08, 2003, 12:47:37 AM
just copy and edit ?
or do I need the extra stuff in the top bar
Title: Directory?
Post by: epsilon on December 09, 2003, 03:28:23 PM
In what directorie i must put this htaccess?
Title: Hotlinking
Post by: Joachim Müller on December 09, 2003, 05:33:31 PM
albums folder will do.

GauGau
Title: Error when i put the htaccess...
Post by: epsilon on December 10, 2003, 09:07:57 PM
When i put the .htaccess to protect my images i dont see the images in my web site, broken thumbnails, etc... :(  :roll:  What can i do? Only if i delete the .htaccess the gallery runs well. . .. .
Title: Hotlinking
Post by: Joachim Müller on December 13, 2003, 08:55:53 PM
post the code of the .htaccess file you used here.

GauGau
Title: I tried the 3 htacces codes of this topic and error...
Post by: epsilon on December 15, 2003, 07:25:20 PM
I tried all in htaccess my server has rewrite mode ON This is the php info of my server http://www.cremita.com/phpinfo.php and i dont know what fails but i get (forbidden acess to the server error) you are not authorized to... I cant see the images in the web of /album when .htaccess is here, please help me, i really need to do that.