Automatic redirections

At the end of an action, after the return of the function, SPIP redirects the page to a redirection URL passed in the redirect variable. The functions to generate the links to the secured actions, like generer_action_auteur(), have a parameter to receive this redirection link.

Forcing a redirection

Some actions, however, can force a different redirection, or define a default redirection. To do this, you must call the redirige_par_entete() function, which enables redirecting the browser to a different page.

Example:

Simply redirect to the redirection URL requested:

if ($redirect = _request('redirect')) {
	include_spip('inc/headers');
	redirige_par_entete($redirect);
}

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français