Piwigo.org

You are not logged in. (Register / Login)

Announcement

#16 2012-05-17 16:50:57

mistic100
Piwigo Team
Location: Avignon (Fr)
Registered: 2008-09-27
Posts: 1450
Website

Re: [multisize] hotlinks and upgrade

ok flop, let's do that

plg wrote:

1) the hotlink on the "web size" becomes a hotlink on the original
2) the hotlink on the HD no longer works
3) the hotlink on the thumbnail no longer works

as finally the file is generated by PHP here is a proposal which solves all three points (this is a part of the PHP script)

Code:

## redirect <2.4 thumbnails hotlinks to i.php
RewriteRule ^upload/(.*)/'.preg_quote($conf['dir_thumbnail']).'/'.preg_quote($conf['prefix_thumbnail']).'(.*)\.([a-z0-9]{3,4})$ i.php?/upload/$1/$2-th.$3 [L]
RewriteRule ^galleries/(.*)/'.preg_quote($conf['dir_thumbnail']).'/'.preg_quote($conf['prefix_thumbnail']).'(.*)\.([a-z0-9]{3,4})$ i.php?/galleries/$1/$2-th.$3 [L]

## redirect <2.4 high-def hotlinks to original file
RewriteRule ^upload/(.*)/pwg_high/(.*)\.([a-z0-9]{3,4})$ upload/$1/$2.$3 [L]
RewriteRule ^galleries/(.*)/pwg_high/(.*)\.([a-z0-9]{3,4})$ galleries/$1/$2.$3 [L]

## redirect <2.4 low-def hotlinks to i.php
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?'.preg_quote($_SERVER['SERVER_NAME']).'/.*$ [NC]
RewriteRule ^upload/(.*)/(.*)\.([a-z0-9]{3,4})$ i.php?/upload/$1/$2-me.$3 [L]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?'.preg_quote($_SERVER['SERVER_NAME']).'/.*$ [NC]
RewriteRule ^galleries(.*)/(.*)\.([a-z0-9]{3,4})$ i.php?/galleries/$1/$2-me.$3 [L]

I know, hard to read :)

Offline

#17 2012-05-21 12:20:12

plg
Piwigo Team
Location: Paris, France, Europe
Registered: 2002-04-05
Posts: 11722
Website

Re: [multisize] hotlinks and upgrade

As described in [Forum, post 127016 by rvelices in topic 18648] [2.4] multiple size / original - protection of urls, you should add:

Code:

<IfModule mod_rewrite.c>
...
</IfModule>

Latest blog post on Piwigo.com: Piwigo 2.5 on Piwigo.com (March 7th, 2013)

Offline

#18 2012-05-21 12:27:21

plg
Piwigo Team
Location: Paris, France, Europe
Registered: 2002-04-05
Posts: 11722
Website

Re: [multisize] hotlinks and upgrade

Did you make sure that you didn't overwrite any existing .htaccess?


Latest blog post on Piwigo.com: Piwigo 2.5 on Piwigo.com (March 7th, 2013)

Offline

#19 2012-05-21 12:34:41

mistic100
Piwigo Team
Location: Avignon (Fr)
Registered: 2008-09-27
Posts: 1450
Website

Re: [multisize] hotlinks and upgrade

plg wrote:

As described in [Forum, post 127016 by rvelices in topic 18648] [2.4] multiple size / original - protection of urls, you should add:

Code:

<IfModule mod_rewrite.c>
...
</IfModule>

done

plg wrote:

Did you make sure that you didn't overwrite any existing .htaccess?

yes

Offline

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013