Multi-domains problem?

Hello,

I tried to set up the multi-domains plugin. I followed the instructions but you see the following error on this site which I want to be part of the network [Edit: Link removed at user request] . I am using a dedicated hosting (not shared). I am using Blue host and have other domains hosted on this account, including the WP multi-site and the site [Edit: Link removed at user request] which I want to be part of the multi-site network: see the screen [Edit: Link removed at user request]

IP address :173.254.13.227

Warning: Cannot modify header information – headers already sent by (output started at /home4/beyondes/public_html/DOMAIN/index.php:48) in /home4/beyondes/public_html/DOMAIN/wp-content/sunrise.php on line 42

  • dustinmattison
    • The Incredible Code Injector

    I tried doing what was specified above, but nothing changed. Any other recommendations? Do I have to do the editing in a text editor, or can I do it right within the cpanel edit file? I did it on sunrise.php as well as config.php and login.php

    Dustin

  • dustinmattison
    • The Incredible Code Injector

    Here is the sunrise.php

    <?php

    if ( defined( ‘COOKIE_DOMAIN’ ) )

    die( ‘The constant “COOKIE_DOMAIN” is defined (probably in wp-config.php). Please remove or comment out that define() line.’ );

    // Compatibility mode

    define(‘DM_COMPATIBILITY’, ‘yes’:wink:;

    // domain mapping plugin to handle VHOST and non VHOST installation

    global $wpdb;

    // No if statement needed as the code was the same for both VHOST and non VHOST installations

    if(defined(‘DM_COMPATIBILITY’:wink:) {

    $wpdb->dmtable = $wpdb->base_prefix . ‘domain_mapping’;

    } else {

    $wpdb->dmtable = $wpdb->base_prefix . ‘domain_map’;

    }

    $wpdb->suppress_errors();

    $using_domain = $wpdb->escape( preg_replace( “/^www./”, “”, $_SERVER[ ‘HTTP_HOST’ ] ) );

    $mapped_id = $wpdb->get_var( “SELECT blog_id FROM {$wpdb->dmtable} WHERE domain = ‘{$using_domain}’ LIMIT 1 /* domain mapping */” );

    $wpdb->suppress_errors( false );

    if ( !$mapped_id && ( preg_replace( “/^www./”, “”, DOMAIN_CURRENT_SITE ) !== $using_domain ) ) {

    $md_domains = unserialize( $wpdb->get_var( “SELECT meta_value FROM {$wpdb->sitemeta} WHERE meta_key = ‘md_domains’ AND site_id = 1” ) );

    if( $_SERVER == ‘/’ ) {

    foreach ( $md_domains as $domain ) {

    if( $_SERVER == strtolower( $domain ) ) {

    $location = ‘http://’ . DOMAIN_CURRENT_SITE;

    if ( strpos( $_SERVER, ‘Microsoft-IIS’ ) == true || strpos( $_SERVER, ‘ExpressionDevServer’ ) == true ) {

    header( “Refresh: 0;url=$location “:wink:;

    } else {

    if ( php_sapi_name() != ‘cgi-fcgi’ )

    status_header($status); // This causes problems on IIS and some FastCGI setups

    header( “Location: $location”, true, 301 );

    }

    die;

    }

    }

    }

    foreach( $md_domains as $domain ) {

    if ( preg_match( ‘|’ . strtolower( $domain ) . ‘$|’, $using_domain ) ) {

    define( ‘COOKIE_DOMAIN’, ‘.’ . strtolower( $domain ) );

    break;

    }

    }

    }

    if( $mapped_id ) {

    $current_blog = $wpdb->get_row( $wpdb->prepare( “SELECT * FROM $wpdb->blogs WHERE blog_id = %d LIMIT 1 /* domain mapping */”, $mapped_id ) );

    $current_blog->domain = $_SERVER[ ‘HTTP_HOST’ ];

    $blog_id = $mapped_id;

    $site_id = $current_blog->site_id;

    define( ‘COOKIE_DOMAIN’, $_SERVER[ ‘HTTP_HOST’ ] );

    $current_site = $wpdb->get_row( $wpdb->prepare( “SELECT * FROM $wpdb->site WHERE id = %d /* domain mapping */”, $current_blog->site_id ) );

    $current_site->blog_id = $wpdb->get_var( $wpdb->prepare( “SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s /* domain mapping */”, $current_site->domain, $current_site->path ) );

    $current_blog->path = $current_site->path;

    define( ‘DOMAIN_MAPPING’, 1 );

    // Added for belt and braces

    if ( !defined(‘WP_CONTENT_URL’:wink: ) {

    $protocol = ( isset( $_SERVER ) && ‘on’ == strtolower( $_SERVER ) ) ? ‘https://’ : ‘http://’;

    define( ‘WP_CONTENT_URL’, $protocol . $current_blog->domain . $current_blog->path . ‘wp-content’:wink:; // full url – WP_CONTENT_DIR is defined further up

    }

    }

    ?>

  • Mason
    • DEV MAN’s Sidekick

    Hiya Dustin,

    I also installed domain mapping and and the supporter plugin, but I don’t think they are completely installed yet. Could this affect it?

    No. That shouldn’t have any affect. Can you try uploading a new copy of sunrise.php? Also are you using the one that comes with multi-domains? It is different from the one that comes with domain mapping.

    As to the active theme question, which theme do you have active? Sounds like a coding error, but if I can take a look at the theme can let ya know for sure.

    Thanks!

  • dustinmattison
    • The Incredible Code Injector

    I re-uploaded sunrise.php, the one that comes with mulit-domains. The problem was not fixed. Then I tried re-uploading the sunrise.php that comes with domain mapping. Still no change.

    My active theme is scholar child. Still have this problem too:

    Your active theme:

    Has the call to <?php wp_head(); ?> but it is not called directly before </head>

    Has the call to <?php wp_footer(); ?> but it is not called directly before </body>

  • dustinmattison
    • The Incredible Code Injector

    I re-installed WordPress. The mult-domains seems to be working now. However, how do I do the following:

    This site [Edit: Link removed at user request] points to the Multi-site network [Edit: Link removed at user request] AND I want to maintain [Edit: Link removed at user request] as the URL visited. I want it to appear it is its own site with its own identity, not as [Edit: Link removed at user request]

  • Mason
    • DEV MAN’s Sidekick

    Hiya Dustin,

    Glad to hear the reinstall helped :slight_smile:

    I’m showing a 302 Temporary Redirect on [Edit: Link removed at user request]. This would be something done at the domain registrar. Make sure you have no forwarding for this domain. You simply need to set an a record in your DNS settings.

    Thanks!

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    As we haven’t heard back from ya with any response in awhile I’m gonna mark this one resolved. If you’d like to go through anything further, feel free to re-open this thread. Alternately, you can also always open up a new one.

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.