Coppermine and hotlinking protection

Fix it!!

HTTP_REFERER

Postby franco7777 » Mon Jan 22, 2007 9:10 pm

Richardk:
I have coppermine installed on my website (Specially for Images)
If I set up this code at:
http://mydomain.com/coppermine/userspic/1001/ (.htaccess goes here)
.htaccess code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/coppermine/userpics/1001/.*$ [NC]
RewriteRule .*\.(gif|jpg)$ - [N,F,L]
When I go to:
http://mydoamin.com/coppermine
Results > NO PICTURES OR IMAGES APPEAR AT ALL!!!
How can we solve that?
I have windows as my OP!.
Regards
Franco7777 :o
franco7777
 
Posts: 4
Joined: Sun Jan 21, 2007 9:24 am
Location: Nicaragua

Postby richardk » Tue Jan 23, 2007 8:48 am

mydomain.com/coppermine/ doesn't match mydomain.com/coppermine/userpics/1001/.

Code: Select all
!^http://mydomain.com/coppermine(/.*)?$
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

HTTP_REFERER

Postby franco7777 » Tue Jan 23, 2007 10:10 am

RichardK:
I am sorry to bother you again.
I have not been able to understand the logic behind
the fact that NO IMAGES OR PICTURES APPEAR AT ALL!!!.
If I set it up as you suggested; nothing absolutely nothing
happens.
I did some links from a cybercafe, inserted a banner with one of the pictures at another site, etc.
Honestly, I have not quiet understood what exactly the code does or how it really works.
Apache Docs, are not very clear nor complete.
I have checked my Apache logs (errors) can not see errors as of jet.
Regards
Franco :o
franco7777
 
Posts: 4
Joined: Sun Jan 21, 2007 9:24 am
Location: Nicaragua

Postby richardk » Tue Jan 23, 2007 3:19 pm

the fact that NO IMAGES OR PICTURES APPEAR AT ALL!!!.

Even images not in the /coppermine/userspic/1001/ directory? Even from different domains? Then i don't see how it can be the mod_rewrite.

Try:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_REFERER} !^(http://(www\.)?mydomain\.com/coppermine(/.*)?)?$ [NC]
RewriteRule \.(gif|jpg)$ - [NC,F,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

http-Referer

Postby franco7777 » Tue Jan 23, 2007 8:18 pm

RichardK:
I installed coppermine a week ago, and it only has 5 Images at the mentioned directory; coppermine keeps thumbnails(Small), a normal and a big one; they all are .gif.
I inserted your code and Again : NO IMAGES OR PICTURES APPEAR AT ALL!!!
I take away the .htaccess file and everything goes back to normal; which means that the code, the old one and the one you just gave me work in a strange way, I think!. Or is that what it is supposed to do?
My Operating System is Windows XP prof. SP2
Regards franco
:o
franco7777
 
Posts: 4
Joined: Sun Jan 21, 2007 9:24 am
Location: Nicaragua

Postby richardk » Fri Jan 26, 2007 10:09 am

If the .htaccess file is in the /coppermine/userspic/1001 directory it can only affect images in that dircetory.

If the pages accessing the images need to be in /coppermine directory, then images should appear.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby franco7777 » Wed Jan 31, 2007 11:37 am

RichardK:
Thanks very much for your time and
expert advice.
I think I solved my problem.
Regards.
Franco :D
franco7777
 
Posts: 4
Joined: Sun Jan 21, 2007 9:24 am
Location: Nicaragua


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 1 guest

cron