简体   繁体   English

Wordpress重定向循环错误

[英]Wordpress Redirect Loop Error

Had a dev build a theme for wordpress. 有一个开发人员为wordpress构建一个主题。 The site is beonpointe.com - have tried to make it live and the url just redirects to /index1.html - there is no domain forwarding with the host, neither is there any domain forwarding in the HTACCESS. 该网站是beonpointe.com - 试图让它生效,网址只是重定向到/index1.html - 主机没有域转发,HTACCESS中也没有域转发。

I found a snippet in the theme's functions.php, but uncommented it to see if it would work, and it still doesn't. 我在主题的functions.php中找到了一个片段,但是取消注释它是否可行,但它仍然没有。 Please could anyone help?! 请有人帮忙吗?!

The code snippet was: 代码段是:

<?php 
define('TEMPLATE_DOMAIN', 'beonpointe'); 
define('BOP_IS_LIVE', 'true'); 

function only_admin_access(){ 
    if( BOP_IS_LIVE == 'true' ): 
        if( !is_user_logged_in() ): 
            wp_redirect( site_url('') ); 
        endif; 
    endif; 
}
add_action('wp_top_head', 'only_admin_access'); 
?>

It would be much appreciated. 非常感谢。 I thank you in advance. 我提前谢谢你。

<?php 
define('TEMPLATE_DOMAIN', 'beonpointe'); 
define('BOP_IS_LIVE', 'true'); 

function only_admin_access(){ 
    if( BOP_IS_LIVE == 'true' ): 
        if( !is_user_logged_in() ): 
           wp_redirect( home_url() ); 
           exit;
        endif; 
    endif; 
}
add_action('wp_top_head', 'only_admin_access'); 
?>

More info ro redirect 更多信息ro redirect

将以下内容添加到wp-config.php:

 $_SERVER['HTTPS'] = 'on';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM