【发布时间】:2017-03-20 05:11:45
【问题描述】:
我需要将来自某个网址“http://www.example.com/wp-includes/qp2qp-sktcho/”的访问者重定向到他们在 wordpress “http://www.example.com/author/username”中的作者页面,并且我在其中一个主题文件中使用此代码
if($_SERVER['HTTP_REFERER']){
if($_SERVER['HTTP_REFERER'] == "http://www.example.com/wp-includes/qp2qp-sktcho/" && is_user_logged_in()){
$targetUrl = get_author_posts_url($user->user_nicename );
wp_redirect( $targetUrl );
add_action('pre_get_posts','wh_post_display_order_view');
exit;
}
}
但不是重定向到“http://www.example.com/author/username” 它重定向到“http://www.example.com/author/”
你知道代码有什么用吗? 谢谢
【问题讨论】:
标签: wordpress