Replacing legacy web galleries while preserving links

Back in 2002 my friend, Kyle, wrote an easy to use image gallery in PHP called “phish”. It was so good that many other people on the same web server used it on their own site, and since we were all sharing a single student webserver, deploying it was a matter of copying the files from his (world-readable) home directory to your own, and he kindly licensed the code under the GPL to allow us to do that.

Twenty years later phish was, until yesterday, still being used to display the older photographs on this website. The original code was written for PHP version 4, and over the years I had made minor fixes to keep it running on modern versions. These were published on GitHub to ensure I was complying with the original licence.

The PHP language keeps moving forward and the challenge of keeping such old code working meant I had been considering for some time how to modernise these older galleries. I evaluated a few options before settling on sigal as being the simplest to use, but then hit the problem of how to preserve my incoming links. The disadvantage of running your own software may be keeping up with maintenance, but the advantage is the control it gives you when it comes to replacement. In this case, I was able to replace the phish index.php with a new script which calculates the new location of the piece of content your web browser has requested and seamlessly redirects you. Having tested all the links I could find within my own site, it seems to work pretty well but please do let me know if you spot any problems.

So what about the next migration? Sigal generates static webpages rather than creating them on-the-fly for each request but the gallery theme (photoswipe) uses Javascript and CSS to display the images and provide the navigation. In the short term I hope that sigal will continue to be maintained by its author so I do not need to do the maintenance work. Longer term, whilst I currently have no experience with Javascript, I hope I can learn enough in the future to perform the same redirection trick for its gallery parameters (the #&gid=1&pid=3 after index.html) when the time comes.

Thanks for reading and you can now visit the new (old) galleries.