Codex

Function Reference/wp redirect

Contents

Description

Redirects the user to a specified absolute URI.

Parameters

$location
(string) (required) The absolute URI which the user will be redirected to.
Default: None
$status
(integer) (optional) The status code to use.
Default: 302

Usage

 <?php wp_redirect($location$status); ?> 

Example

<?php wp_redirect(get_option('siteurl') . '/wp-login.php'); ?>

Redirects can also be external, and/or use a "Moved Permanently" code :

<?php wp_redirect('http://www.example.com', 301); ?>