Pages: 1
I have many pictures from New Zealand. When I started, I organized albums by year, eg Auckland-2011, Auckland-2013. This year I decided that's getting silly. Too many albums, and the year a photo was taken is not that important. So I want to have just one album for each region.
But I want to be sure that any old links people might have would still work. So Auckland-2013/Corybas-oblonga.png would transparently take the user to Auckland/Corybas-oblonga.png.
At first I thought I'd just make links in the directories, but I don't think that'll work right. Piwigo has it's own way of making urls, and it seems to treat a link as simply a duplicate file. Not what I want to achieve.
How can I do this? Reorganize the directories but allow old links to point to the new locations?
TIA for your help!
Piwigo version: 2.7.4
PHP version:
MySQL version:
Piwigo URL: http://molvray.com/photos
Last edited by quixote (2015-12-15 03:25:48)
Offline
Eeep. Don't tell me there's no way to do this?
Offline
(I just edited the subject line to reflect desperation more accurately. I simply cannot figure this out no matter what I try. There has to be some way to redirect links to the current location of photos? An extension perhaps??)
Offline
Hello
If you use ftp upload + sync, this is just not possible, it was never designed to be flexible.
The only thing you can do is to create a new virtual album, associate all you photos to it, and make the original albums private.
But you can't move the files.
But If you address using custom url style you will still have broken links
Offline
Thanks for your answer! The workaround is tedious but at least possible, so that's what I'll do.
I thought of virtual albums, but they were still cluttering up my directory list because it didn't occur to me that I could make them private. A good idea.
I realize it would be a rather big coding project to come up with link re-direction, but I guess this is a Request For Feature!
Offline
Turns out, it's not quite resolved.
The virtual albums allow me to put all photos in one album with a more general name, while the original albums still exist and the links aren't broken. So far so good.
But if I make the original albums private, an old link to a photo in the original album demands a login. That's not what I want at all.
If I allow "guest" access to the "private" album (so that login is not an issue), then the original album is cluttering up the list of albums again.
So I guess now I have a related question: Is there some way to NOT display some albums without putting them behind a login?
Thanks again for all help!
Offline
Hey, mistic100, I see you're the author of the extension physical2vritual which makes virtual albums and "hide source albums from users."
!
That's exactly what I'm trying to do. Should I install the extension? Is there some bit of code I can tweak to do that just for the albums I want?
I still haven't found a way past the login problem if I make the albums private.
Offline
I'm not the author...
It will not solve your problem.
Extended description allow to hide albums with a special keyword in the name (cf its doc)
Offline
Oh. Ah well. So it sounds like there ain't no way to get there from here. I need one of those many-tears icons here!
Some way to redirect old links after album reorganization really would be a very useful feature for piwigo, especially for long term users who gradually realize they set it up all wrong! ;-)
Offline
You could use some clever redirect rules in your .htaccess to accomplish this (provided you're using apache). But there could be quite a bit of effort and rules depending on your old naming schema.
For example:
RedirectMatch "/(.*)-2011/(.*)" "/$1/$2"
RedirectMatch "/(.*)-2013/(.*)" "/$1/$2"
These would redirect as follows:
/Auckland-2013/Corybas-oblonga.png ==== /Auckland/Corybas-oblonga.png
/Auckland-2011/Corybas-oblonga.png ==== /Auckland/Corybas-oblonga.png
/NewYork-2011/someotherpicture.png ==== /NewYork/someotherpicture.png
(I'm pulling these rules from memory, so you may need to verify syntax)
Caveat would be if you had a photo in 2013 and 2011 named the same but different pics.
IE:
/NewYork-2013/timessquare.jpg
/NewYork-2011/timessquare.jpg
both would point to:
/NewYork/timessquare.jpg
But I suppose if you're collapsing directories, you've already dealt with duplicate filenames.
Last edited by jnashpiwigo (2015-12-18 01:44:07)
Offline
Thanks for that detailed response! I'm keeping that in my list of tips-on-dealing-with-problems for the next time this comes up for me. Luckily for this solution, I don't have duplicate file names. I think. :/ What I do have is dozens of directories, so the redirects would require a lot of time to set up in this case.
Anyway, for now, what I did was put together a new 404 page so that any lost souls at least had a chance of finding what they wanted. It's a kludge, not a solution, but at least it's something.
Offline
Pages: 1