Plupy started as a small collection of free activities for kids. Each activity had its own HTML file. That got the site online quickly, but adding an activity meant touching more than one page: the activity itself, the full list, and sometimes the homepage.
I wanted to edit the activity in one place. I also wanted a link like Paper Bridge Lab to keep working exactly as before. People had already shared links to the activities. They didn't need to know I was changing how the pages were built.
One catalogue, a few templates
I moved the activity data into a JSON catalogue and used PHP to render it with shared templates. The activity title and age range now come from the same data whether you're on the homepage, in the activity list, or on an activity page. The homepage always leads with the Vanishing Party Hat and rotates the other two picks. The age filter only offers ages covered by at least one activity.
A database would have given me a way to edit content through an admin screen, but I wasn't building one. For a small catalogue I edit myself, a single data file is enough.
Keep the old URL and change what serves it
On Apache with mod_rewrite and rewrite rules enabled for the site, a root .htaccess can send an old URL to a PHP file without redirecting the browser. Here's a simplified example for one page, not Plupy's production configuration:
RewriteEngine On
RewriteRule ^paper-bridge-lab\.html$ activity.php [L]
With a simple activity.php in the same directory, requesting /paper-bridge-lab.html runs that file. No [R] flag, no new address in the browser. For this one-page example, activity.php can just contain <?php echo 'Paper Bridge Lab';. Plupy uses shared rendering for the catalogue rather than writing one PHP file per activity.
The exact match matters. It leaves CSS, PDFs, and unrelated URLs alone. If you expand the rule into an activity router, look the slug up in the catalogue and return a real HTTP 404 when it isn't there. Don't build a PHP include path from the incoming slug.
What I'd check before deleting any old files
-
Open a shared link directly. Start with a real activity URL such as
/paper-bridge-lab.html. Check the status as well as the page: it should be a 200, with no redirect to a new URL. - Check the bits a 200 can't tell you. Open the activity list, try an age filter, follow an activity link and open its printable. Make sure a made-up activity URL still returns 404.
- Keep a rollback you can actually use. Once you've deleted the old HTML files, undoing the rewrite isn't enough. Keep a complete copy of the old pages and the matching configuration so you can restore both together.
My biggest takeaway was that changing templates and changing URLs are two separate decisions. I had a good reason to change the first and no reason to change the second.
Hosting disclosure: Plupy runs on shared hosting from SupremeCenterHost, my reseller storefront. I may earn a commission if you purchase through it. The example uses ordinary Apache and PHP features and isn't specific to that host.
AI disclosure: This case study was drafted with ChatGPT based on the actual Plupy migration.
Top comments (0)