2014-12-19 58 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';