Jump to content

Recommended Posts

Posted

Bonjour,

j'ai mis en ligne une galerie de photo sur mon site via coppermine (cpg148), les photos se trouvent sous un repertoire repphoto.

je souhaiterai interdire le référéncement des photos par des sites exterieurs et je souhaiterai egalement interdire l'accès direct aux photos.

(passage obligé => coppermine)

Il me semble que le fichier .htaccess pourrait, via des expressions regulieres, le faire.

pensez vous que ces conditions pourraient le faire :

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^http://monsite.fr/.*$ [OR]

RewriteCond %{HTTP_REFERER} !^http://monsite.fr$ [OR]

RewriteCond %{HTTP_REFERER} !^http://www.monsite.fr/cpg148/.*$ [OR]

RewriteCond %{HTTP_REFERER} !^http://www.monsite.fr/cpg148$ [OR]

RewriteCond %{HTTP_REFERER} ^http://www.monsite.fr/cpg148/repphoto$ [OR]

RewriteCond %{HTTP_REFERER} ^http://www.monsite.fr/cpg148/repphoto/.* [OR]

RewriteCond %{HTTP_REFERER} ^http://monsite.fr/cpg148/repphoto$ [OR]

RewriteCond %{HTTP_REFERER} ^http://monsite.fr/cpg148/repphoto/.*

RewriteRule .*\.(JPG|jpg|jpeg|gif|png|bmp)$ - [F,NC]

Par avance, Merci.

Cordialement

Posted

Bonjour,

Perso j'ai mis ceci. Je suis aussi sous Coppermine 148

SetEnvIfNoCase Referer "^http://www.photos-voyage.fr/" locally_linked=1
SetEnvIfNoCase Referer "^http://photos-voyage.fr/" locally_linked=1
SetEnvIf Referer "^$" locally_linked=1
<FilesMatch "\.(gif|png|jpe?g)$">
Order Allow,Deny
Allow from env=locally_linked
</FilesMatch>

Dans ton code, tu ne gères pas le référant "vide"... et quantité de lignes sont inutiles.

De plus, le [OR] en fin de chaque ligne fausse le jeu. Au moins l'une de ces conditions sera toujours vraie, donc tu interdiras les images à tous :)

Si tu mets ces deux lignes, elles remplacent toutes les autres:

RewriteCond %{HTTP_REFERER} !^http://(www.)?monsite.fr
RewriteCond %{HTTP_REFERER} !^$

PS: pour info, GALERIE s'écrit avec un seul L contrairement à GALLERY, au cas où tu utilises ce mot en titre de ta galerie photo ;)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...