•  » Engine
  •  » photo direct link protection for all sizes

#1 2013-05-03 16:13:41

Kalle
Member
2012-08-17
89

photo direct link protection for all sizes

I like to protect the photos again using the direct link from outside of piwigo or without login.

This should possibe by htaccess, rewriteRule and some changes to i.php?

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule (.*) /i.php?pwg_uri=/file_proxy/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
  Order Deny,Allow
  Deny from All
</IfModule>

Offline

 

#2 2013-05-03 18:23:58

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: photo direct link protection for all sizes

you don't have to modify any file

juste use a rewrite condition to test the referer before teh rewrite rule

Code:

RewriteCond %{HTTP_REFERER} !^http://(www\.)?my-site.com/.*$ [NC]

ps : protecting i.php is not enough, you must protect _data/i folder too

Offline

 

#3 2013-05-04 00:13:02

Kalle
Member
2012-08-17
89

Re: photo direct link protection for all sizes

The sample is created from a htaccess file of an other gallery software that protect all photo directorys. Every picture is loaded by php, like the new orginal protection of piwigo.

Offline

 
  •  » Engine
  •  » photo direct link protection for all sizes

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2025 · Contact