Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

I can't get wp_redirect working correctly? I thought I'd figured this out (see wp_redirect not working when going to www version of sitewp_redirect not working when going to www version of site) but apparently not; no idea what changed between last week when it was working and now. I tried simplifying the function down but using the following I get an infinite-redirect error:

add_action ('after_setup_theme','mkm_restrict_access',10);
function mkm_restrict_access() {
    if (!is_user_logged_in() && !is_page('splashpage') && !is_page('login')) {
        wp_redirect('http://localhost.localdomain/clientname/wp/splashpage/'); 
        exit; 
    }
}

I've tried using wp_footer and almost everything up the chain in terms of calling the function but nothing seems to help. I am running Theme My Login and User Domain Whitelist, if that matters. I tried disabling them but it didn't help.

I suspect I'm doing something REALLY STUPID. :( Thanks for your help!

I can't get wp_redirect working correctly? I thought I'd figured this out (see wp_redirect not working when going to www version of site) but apparently not; no idea what changed between last week when it was working and now. I tried simplifying the function down but using the following I get an infinite-redirect error:

add_action ('after_setup_theme','mkm_restrict_access',10);
function mkm_restrict_access() {
    if (!is_user_logged_in() && !is_page('splashpage') && !is_page('login')) {
        wp_redirect('http://localhost.localdomain/clientname/wp/splashpage/'); 
        exit; 
    }
}

I've tried using wp_footer and almost everything up the chain in terms of calling the function but nothing seems to help. I am running Theme My Login and User Domain Whitelist, if that matters. I tried disabling them but it didn't help.

I suspect I'm doing something REALLY STUPID. :( Thanks for your help!

I can't get wp_redirect working correctly? I thought I'd figured this out (see wp_redirect not working when going to www version of site) but apparently not; no idea what changed between last week when it was working and now. I tried simplifying the function down but using the following I get an infinite-redirect error:

add_action ('after_setup_theme','mkm_restrict_access',10);
function mkm_restrict_access() {
    if (!is_user_logged_in() && !is_page('splashpage') && !is_page('login')) {
        wp_redirect('http://localhost.localdomain/clientname/wp/splashpage/'); 
        exit; 
    }
}

I've tried using wp_footer and almost everything up the chain in terms of calling the function but nothing seems to help. I am running Theme My Login and User Domain Whitelist, if that matters. I tried disabling them but it didn't help.

I suspect I'm doing something REALLY STUPID. :( Thanks for your help!

Source Link
Michelle
  • 3.5k
  • 4
  • 26
  • 34

Cannot get redirect working

I can't get wp_redirect working correctly? I thought I'd figured this out (see wp_redirect not working when going to www version of site) but apparently not; no idea what changed between last week when it was working and now. I tried simplifying the function down but using the following I get an infinite-redirect error:

add_action ('after_setup_theme','mkm_restrict_access',10);
function mkm_restrict_access() {
    if (!is_user_logged_in() && !is_page('splashpage') && !is_page('login')) {
        wp_redirect('http://localhost.localdomain/clientname/wp/splashpage/'); 
        exit; 
    }
}

I've tried using wp_footer and almost everything up the chain in terms of calling the function but nothing seems to help. I am running Theme My Login and User Domain Whitelist, if that matters. I tried disabling them but it didn't help.

I suspect I'm doing something REALLY STUPID. :( Thanks for your help!