Testing a Redirect Without Guessing
Retrospective web development exercise for the 2016 archive.
A redirect is easy to test in a browser, but the browser can hide the intermediate response. Ask for the old URL with curl -sS -D - -o /dev/null and look at the status and Location header. Then request the destination separately.
Look for accidental chains such as an old page going to a temporary address and then to the final page. If you own the redirect rules, point the old page at the intended destination directly. Recheck both addresses and confirm the redirect doesn’t send you back to its own starting point.