urlHandler may find from urlmap that it should redirect an erroneous request to an existing page. Perhaps from badurl.html to goodurl.php. To do so, it gives control over to this page, redirect.php. To pass the destination to redirect.php, urlHandler first sets $sp->thispage to the new destination, goodurl.php.
The work of redirct.php is done by setting headers. (So nothing can have been sent back to the client before invoking redirect.php.) These headers are sent:
http_response_code(301); // moved permanently
header("Location: goodurl.php");
During the redirection, the user may see a Physpics page whose sole contents is:
Teleporting you to goodurl.php.