The MU forums have moved to WordPress.org

Redirect the Root Blog to a subdomain (7 posts)

  1. psvolley
    Member
    Posted 14 years ago #

    Is it possible to redirect the home page (root install) of wpmu to a subdomain blog? If so how?

    My main reason for wanting to do this is to essentially hide the BuddyPress 1.1 theme from my home page. I only want to use a BP theme for the social layer, not take over the home page of the site.

    Trying to think logically, this could be one way to do it, without trying to merge my buddypress and wordpress themes together.

    Any advice would be greatly appreciated.

    Thanks
    Paul

  2. STDestiny
    Member
    Posted 14 years ago #

    Make a new theme with only and index.php and add the following code to it:

    <?php
    header( 'Location: http://sub.domain.com/&#39; ) ;
    ?>

    Make sure that is the only code in the file and that there is no white space before the <?php. And of course, change sub.domain.com to the address you want to forward to.

  3. andrea_r
    Moderator
    Posted 14 years ago #

    Activate BP on a second blog, not the main blog. Yes, you can do that. :D

  4. andrea_r
    Moderator
    Posted 14 years ago #

    addendum: If you do this, you may also need to define the BP_root in wp-config so it know where to redirect people.

  5. psvolley
    Member
    Posted 14 years ago #

    Thanks for the tips. I think I can use the BP theme on my Members Area Home page, so activating it there can work well.

    re: defining the BP_root can you please advise on how and where to place this. I found the code:

    define( 'BP_ROOT_BLOG', [blog ID of secondary blog here] );

    but is there a specific place to put it in the wp-config file?

    Thanks again for your help.

    Paul

  6. andrea_r
    Moderator
    Posted 14 years ago #

    Nope, just dump it in there somewhere in the middle.

  7. mattmaan
    Member
    Posted 14 years ago #

    Thanks for the answers all!
    NOTE: There is an extra ';' in STDestiny's redirect code.

About this Topic

  • Started 14 years ago by psvolley
  • Latest reply from mattmaan