wp_redirect works on localhost but conflicts not on my host

505 Views Asked by At

I'm having a weird problem, I have the following code in my page.php template file:

      if (is_page('redirect')) :
           wp_redirect( get_option('home') );
      else:
           //Do something else
      endif;

This works fine on my localhost, but when I upload it to my server it gives me the Headers already sent by pluggable.php, I understand there must be no output before calling this function but there isn't! Also I disabled my only plugin installed (buddypress) and nothing, there must be something on my host because otherwise it woudln't work on my localhost either.

Does anyone know what could be wrong??

Thanks in advance

1

There are 1 best solutions below

0
On BEST ANSWER

Nvm, for some reason I updated WP to 3.1 and it fixed.