Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress not on themainblog ?

  • @johnwinch42

    Participant

    Hello,

    I would like to know if it would be possible to setup buddypress on a secondary blog instead of themainblog in a multi-blogging configuration. If someone could help me understand better the “organigram”, it would be greatly appreciated.

    themainblog / my main blog with the bp nav bar
    blogwithbuddypres.themainblog.com / the blog with the buddypress’s function
    blogname.themainblog.com / a blog from the network with the bp nav bar

    How themainblog and blogwithbuddypress will interact between them and blogname.themainblog.com ? When someone create a blog, what will be the path ? Will it be blogname.themainblog.com or something related to blogwithbuddypress.themainblog.com ?

    Thank for your help.

    Best regards,

Viewing 20 replies - 1 through 20 (of 20 total)
  • @r-a-y

    Keymaster

    Check out this codex article:
    https://codex.buddypress.org/how-to-guides/install-buddypress-on-a-secondary-blog/

    Make sure your WP network is setup as a subdomain.

    Blogs would be created at:
    xxx.themainblog.com

    Interacting should be seamless. BP Admin bar will show up on all sites by default.

    @johnwinch42

    Participant

    Hello,

    Thanks you very much for helping me.

    I’ve followed your link but I’ve got a problem.

    (3) Keep your old BuddyPress user / group avatars
    I don’t find my file bp-custom.php (at the following location : wp-content/plugins/buddypress/), should I create one or is it at an another location ? I’ve looked but I didn’t find anything.

    (4) Redirect previous BuddyPress permalinks
    I’ve edited my .htaccess but when I click on my name from a comment I’ve made on a post on the blog’s network or if I try to view an activity I end up on the same page : the Members Directory. I’m using the default buddypress theme on the blog.

    Did I make a mistake on my .htaccess ?

    Here’s the path of my installation, using Wamp :
    http://127.0.0.1/themainblog/ – the main blog
    http://127.0.0.1/themainblog/network/ – where buddypress is enabled.
    http://127.0.0.1/themainblog/blogname/ – a blog from the network

    Here’s how I edited my htaccess :

    RewriteEngine On
    RewriteBase /themainblog/
    RewriteRule ^index.php$ – [L]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    RedirectMatch 301 ^/members/(.*)$ http://127.0.0.1/themainblog/network/members/$1
    RedirectMatch 301 ^/groups/(.*)$ http://127.0.0.1/themainblog/network/groups/$1
    RedirectMatch 301 ^/blogs/(.*)$ http://127.0.0.1/themainblog/network/blogs/$1
    RedirectMatch 301 ^/forums/(.*)$ http://127.0.0.1/themainblog/network/forums/$1

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
    RewriteRule . index.php [L]

    Best regards,

    @r-a-y

    Keymaster

    bp-custom.php resides in /wp-content/plugins/, not /wp-content/plugins/buddypress/.

    Also just to confirm, are you using a subdirectory install?

    @johnwinch42

    Participant

    I have no bp-custom.php in wp-content/plugin/, I’ve got a hello.php and index.php.
    Yes, for now I can only use a subdirectory install. Wamp doesn’t support subdomains.

    @r-a-y

    Keymaster

    You need to create a file called “bp-custom.php” in /wp-content/plugins/.

    Make sure you create the file with opening and closing PHP tags:

    [?php

    //the code

    ?]

    Replace square brackets with triangular ones.

    @johnwinch42

    Participant

    Here’s how I created the file :

    [?php
    define( ‘BP_AVATAR_UPLOAD_PATH’, ‘http://127.0.0.1/themainblog/wp-content/blogs.dir/1/files’ );
    define( ‘BP_AVATAR_URL’, ‘http://127.0.0.1/themainblog/’ );
    ?]

    Should I reinstall buddypress directly on http://127.0.0.1/themainblog/network/ ?
    Maybe this will fix my problems ?

    @r-a-y

    Keymaster

    You’re missing the BP_ROOT_BLOG define.

    Can you quicky go over part (1) in the codex article and add that to your bp-custom.php?
    https://codex.buddypress.org/how-to-guides/install-buddypress-on-a-secondary-blog/

    @johnwinch42

    Participant

    I’ve added define ( ‘BP_ROOT_BLOG’, 9 ); (9 is themainblog/network)

    But I’ve already defined it in wp-config.php, I’ve add it to bp-custom.php but there is no change.

    @r-a-y

    Keymaster

    Ahh okay, wp-config.php is better actually.

    Did you activate BuddyPress network-wide?
    Also, did you enable the BuddyPress Default theme on blog id #9?

    @johnwinch42

    Participant

    Yes but I didn’t had to activate it, it was already network activated (It was previously “linked” to http://127.0.0.1/themainblog/).
    I’ve enabled the theme on blog #9.

    @r-a-y

    Keymaster

    Can you try removing the redirect rules from step (4)?

    So, at the moment, what do you see when you go to /themainblog/network?

    @johnwinch42

    Participant

    I’ve removed the redirect rules.

    At themainblog/network/ there’s the default buddypress theme but when I click on a member’s activity for example I always end up ion the member directory page, If i click on a name from activity It’s getting me to the same page.

    On the activity page, I’ve got two path of link :
    http://127.0.0.1/themainblog/network/members/admin/ – when I’ve posted an update after the relocation of buddypress
    http://127.0.0.1/themainblog/members/admin/ – the old links from the latest updates I’ve posted on my original buddypress installation

    @r-a-y

    Keymaster

    We can worry about redirects later, but does BuddyPress function well besides the old activity links?

    @johnwinch42

    Participant

    The functions seems to be here, but look likes there’s a rewrite redirect problem.

    I can post update, I’ve created a group, I’ve tried to post into it but I had a “There was an error when creating the topic”.

    The links from the nav bar all redirect to the members directory.

    @r-a-y

    Keymaster

    Have you changed your permalinks to something else?
    https://codex.wordpress.org/Settings_Permalinks_SubPanel

    Set it to anything but the default.

    @johnwinch42

    Participant

    I’ve tried to change the permalinks, I always end up on the members directory.

    @johnwinch42

    Participant

    @r-a-y

    Keymaster

    @johnwinch42 – Can you try out the fix in this ticket?
    https://trac.buddypress.org/ticket/2604

    I believe this will fix your problem, as your subdirectory install is located one level deeper than expected.

    @johnwinch42

    Participant

    @r-a-y Thanks you SO MUCH ! This fixed my problem, I’m still having some bad links redirecting to the previous locations on the activity page but when I’ll install my wordpress + buddypres on my server there should be nothing like this, if I define the right BP Root from the beginning. No ?

    I’m using Wamp, I don’t have the possibility to test the subdomain features. Do you think I’ll have the same problem when I’ll install my site on the server using subdomain instead of subdirectory ?

    @r-a-y

    Keymaster

    @johnwinch42 – If you’re just testing BuddyPress locally, I would just login to PHPMyAdmin and clear out your entire activity table so you won’t have to worry about redirections.

    Like you mentioned, once you set the BP_ROOT_BLOG from the onset, you won’t have to worry about redirects whatsoever!

Viewing 20 replies - 1 through 20 (of 20 total)
  • The topic ‘Buddypress not on themainblog ?’ is closed to new replies.
Skip to toolbar