Announcement

#1 2014-11-14 21:58:53

andrewjs18
Member
2014-10-10
50

gallery 3 conversion

Hello,

Does anyone have rewrite rules that'll redirect old gallery 3 links from my gallery to the new url structure with piwigo?  I'd hate to lose all of the links I've posted online.

Piwigo version: 2.7.1
PHP version: 5.3
MySQL version: 5.5

Offline

 

#2 2014-11-14 22:00:11

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

Re: gallery 3 conversion

I don't think identifiers are preserved so you won't be able to do that

Offline

 

#3 2016-03-25 02:23:36

travelsignposts
Member
2015-02-02
19

Re: gallery 3 conversion

Difficult to believe there is no solution to this, but maybe it's so obvious nobody bothers mentioning it!
I have the same problem, but would settle for redirecting to the relevant album.
I tried the solution here https://github.com/channone-arif-nbcuni/gallery but it fails for me during the search the piwigo database phase.
My G3 URLs take the form "http://www.travelsignposts.com/destination/Austria/Vienna/ViennaOpera/vienna-staatsoper_austria_0021". Having had a look at the code in redirect.php in the github reference above, I'm not sure how it could work in my case (or why it doesn't!). My coding abilities are perilously close to negligible, so that is hardly surprising.
Is there a possible solution here that could be developed? I'm sure there must be many other G3 refugees who are in a similar situation.

Hopefully,

Tony

Piwigo 2.8
PHP  5.
MariaDB 5.5.48

Offline

 

#4 2016-03-25 07:29:17

travelsignposts
Member
2015-02-02
19

Re: gallery 3 conversion

Just to add to this, I think this code would redirect the three levels of albums I'm interested in:

Code:

 RedirectMatch 301 /destination/Austria http://www.travelsignposts.com/destinations/index.php/category/208-austria

RedirectMatch 301 /destination/Austria/Vienna/.*/ http://www.travelsignposts.com/destinations/index.php/category/210-vienna

RedirectMatch 301 /destination/Austria/Vienna/Vienna-walking-tour/.* http://www.travelsignposts.com/destinations/index.php/category/212-vienna_walking_tour

but of course would require a line for each album (in my case 768!).  Can someone smarter than me come up with a solution? Basically, I need to extract e.g. "Vienna" from the old URL, make it all lower case, and then search the piwigo albums for "vienna" as the sole element added to the id number and serve up that album page. This last point is important, as there are other albums containing "vienna", e.g. "vienna-walking-tour".

The element to extract would always be the last album in the old URL.

Offline

 

#5 2016-04-06 09:15:38

travelsignposts
Member
2015-02-02
19

Re: gallery 3 conversion

I have hacked the code provided here (https://github.com/channone-arif-nbcuni/gallery) and have two php files (redirectphoto.php and redirectalbum.php) which redirect the Gallery3 URL to the corresponding photo and album in Piwigo respectively.

So I have to send the corresponding URLs to the right php file via .htaccess, but I'm not having much luck.
All my photo files contain the strings "AJP" "DSC" or "IMG", e.g. "hundertwasserhaus_AJP5669".
Here's my current effort, but I'm not having much luck:

Code:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !(.*AJP.*|.*DSC.*|.*IMG.*)$ [NC]
RewriteRule ^(.*)$ /xyz/redirectalbum.php?$1 [R=302,L]
RewriteRule ^(.*)$ /xyz/redirectphoto.php?$1 [R=302,L]

It checks out OK at the htaccess tester at http://htaccess.madewithlove.be/ , but...
Can anyone help with this and show me where I am going wrong?

Tony Page

Offline

 

Board footer

Powered by FluxBB

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