[resolved] PHP coding problem (3 posts)

  1. izaca
    Posted 7 years ago #

    I'm receiving an error message:

    Warning: Cannot modify header information - headers already sent by (output started at /home/izacacom/public_html/blog/wp-content/themes/Izaca_blog/functions.php:11) in /home/izacacom/public_html/blog/wp-includes/pluggable.php on line 39

    ...when I go to my blog with the www in the url (http://www.izaca.com/blog), but it works correctly when the 'www.' is taken out (http://izaca.com/blog). The PHP code that its referring to is below, but I don't know how to fix it.

    if ( !function_exists('wp_redirect') ) :
    function wp_redirect($location, $status = 302) {
    	global $is_IIS;
    	$location = apply_filters('wp_redirect', $location, $status);
    	if ( !$location ) // allows the wp_redirect filter to cancel a redirect
    		return false;
    	$location = wp_sanitize_redirect($location);
    	if ( $is_IIS ) {
    		header("Refresh: 0;url=$location");
    	} else {
    		if ( php_sapi_name() != 'cgi-fcgi' )
    			status_header($status); // This causes problems on IIS and some FastCGI setups
    		header("Location: $location");
  2. ronchicago
    Posted 7 years ago #

  3. izaca
    Posted 7 years ago #

    Thanks, that did it!

Topic Closed

This topic has been closed to new replies.

About this Topic