404 error when user clicks on email message link (not logged in)
What you could do is use something like https://wordpress.org/plugins/all-404-redirect-to-homepage/ and configure that to redirect ll 404’s to the login page.
I’m facing the same issue. It was working fine with earlier versions of BuddyPress, but now when you click “Go to the discussion” link in the email, it redirects to the 404 page.
BuddyPress Version 3.1.0 (latest version)
Can this be resolved within BuddyPress by adding a hook in functions.php or buddypress-functions.php file? Don’t really want to install a redirect plugin, as we still need a 404 page to show.
What’s the attempted link that users are clicking on from their email?
You can remove the website domain for privacy.
Someone reported an issue involving 404s that might be related to this forum thread.
To those experiencing 404s with custom profile or group subnav pages, can you try the following fix?
URL in the email says:
If you are logged in an you click on this link, it works fine and takes you straight to the conversation, but if you are not logged in an click it, it just takes you to the 404 page instead.
Applied the patch, but it does not solve the problem.
bp-messages/?thread_id=43created from a custom plugin? If so, which one? I don’t recognize that URL structure.
There’s a plugin called “BP Better Messages”
The problem is with BP Better Messages:
I tested the plugin in BP v2.9.4 and v3.1.0 and when not logged in, the link 404s and doesn’t redirect either way.
A way to fix this is if the plugin added a subnav at this line:
// Add the subnav items to the profile. $sub_nav = array( 'name' => 'Inbox', 'slug' => 'inbox', 'parent_url' => trailingslashit( bp_displayed_user_domain() . $this->slug ), 'parent_slug' => $this->slug, 'screen_function' => array( $this, 'set_screen' ), 'position' => 10, 'user_has_access' => bp_is_my_profile() );
Or BP Better Messages could write their own redirector code if the user isn’t logged in.
You are my hero @r-a-y
Thanks for this, it worked! Just tested clicking the “Go to the discussion” link in the email when not logged in and it successfully redirected me to the login page instead of 404 page.
Hi there everyone.
Thansk @r-a-y, i will test this and include in next version of plugin.
- You must be logged in to reply to this topic.