2014-12-19 54 views
3

有一个开发者为wordpress构建主题。该网站是beonpointe.com - 已尝试使其生效,并且网址只是重定向到/index1.html - 主机没有域转发,HTACCESS中也没有域转发。Wordpress重定向循环错误

我在主题的functions.php中找到了一个片段,但是取消了它的注释,看看它是否可以工作,但它仍然没有。请任何人都可以帮忙?

的代码片段是:

<?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'); 
?> 

这将不胜感激。我提前谢谢你。

+0

什么[HOME_URL()](http://codex.wordpress.org/Function_Reference/home_url) ? – 2014-12-19 12:56:28

回答

0
<?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

0

添加以下的wp-config.php文件:

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