A reproducible redirect and rollback exercise
Two URL moves, ten HTTP assertions and a controlled rollback. This is a localhost teaching example, not a completed client or WordPress migration.
Teaching example / controlled HTTP test / 22 October 2026
The problem being isolated
A URL move can introduce redirect chains, loops or misleading HTTP 200 pages. This exercise focuses on old addresses, relevant destinations and unknown paths before and after rollback.
The test
A temporary local server redirects /old-service/ to /services/technical-seo/ and /old-contact/ to /contact/ with HTTP 308. Both destinations return 200. /unknown/ returns 404. The client does not automatically follow redirects, allowing the first response to be checked independently.
Rollback
The exercise then restores the old route set. The two old addresses return 200, the two new addresses return 404, and the unknown address remains 404. All ten assertions passed in the recorded run. The server shuts down after testing.
Using the approach in WordPress
Replace example paths with a reviewed inventory. Also test posts, media, metadata, database state, plugins, forms and the actual server rules in protected staging. A rollback must cover the systems that changed. This Python exercise does not restore a WordPress database.
Limits
The test establishes HTTP behaviour in a controlled environment. It does not prove preserved rankings after a migration or recoverability of a production system. The template and code below make the exercise reproducible.
Evidence and reusable files
Examples and implementationTell me what your website needs to do next
Share the address, the situation and the outcome you are working towards. I'll use that context to discuss a sensible starting point.