Function.redirect

redirect –– Redirects the user to another page

Description
Redirects the user to another page then exits the script nicely. This function is intended for urls within the board. It's not meant to redirect to cross-domains.
 * 1) mixed redirect ( $url [, $return [, $disable_cd_check ]] )

Return Values
If the $return parameter is set to true, redirect returns a URL string. Otherwise, it will exit the script upon redirecting the user to the redirect URL.

Example #1 from viewtopic.php
This example shows the redirect function usage within the viewtopic.php page, which is redirecting the user to the topic if the post_id was incorrect but the topic_id was found. if (!$topic_data) {	// If post_id was submitted, we try at least to display the topic as a last resort... if ($post_id && $forum_id && $topic_id) {		redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id")); }

trigger_error('NO_TOPIC'); }

Example #2 from viewforum.php
This example is from viewforum.php and takes the forum_link and redirects it to the URL you specified for that link forum. // We redirect to the url. The third parameter indicates that external redirects are allowed. redirect($forum_data['forum_link'], false, true); exit;

Example #3 Redirect Bots/Spiders
In this example, we will ensure a user is logged in, if not, we display a login box. If they are a bot or spider, we will redirect them to the Board Index. // is the user logged in? if (!$user->data['is_registered']) {   if ($user->data['is_bot']) {       // the user is a bot, send them back to home plate... redirect(append_sid("{$phpbb_root_path}index.$phpEx")); }   // the user is not logged in, give them a chance to login here... login_box('', 'LOGIN'); }