> pictools > doc > redirect
> pictools > doc > redirect
Pictools: Driver Pages
V3.3 (445)
redirect.php
/admin/redirect.php
Process the permanent redirection of an incoming URL
usage, in PHP code: include "redirect.php";

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.

 
Copyright © 2023 ZweiBieren, All rights reserved. Feb 5, 2023 17:05 GMT Page maintained by ZweiBieren