WordPress:Function Reference/wp redirect

来自站长百科
Fludlen讨论 | 贡献2008年7月22日 (二) 15:06的版本
跳转至: 导航、​ 搜索

Description

描述

Redirects the user to a specified absolute URI.

将用户导向规定的absolute URI

Parameters

参数

Usage

用法

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

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

Example

例子

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

<?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); ?>
<?php wp_redirect('http://www.example.com', 301); ?>