Skip to:
Content
Pages
Categories
Search
Top
Bottom

404 error when user clicks on email message link (not logged in)

Viewing 12 replies - 1 through 12 (of 12 total)
  • @venutius

    Moderator

    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.

    @reartwebdesign

    Participant

    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.

    Thanks,
    Erik

    @r-a-y

    Keymaster

    What’s the attempted link that users are clicking on from their email?

    You can remove the website domain for privacy.

    @r-a-y

    Keymaster

    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?
    https://buddypress.trac.wordpress.org/attachment/ticket/7931/7931.01.patch

    @reartwebdesign

    Participant

    URL in the email says:
    http://domain-name.com/members/demo2/bp-messages/?thread_id=43

    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.

    @reartwebdesign

    Participant

    Applied the patch, but it does not solve the problem.

    @r-a-y

    Keymaster

    Is bp-messages/?thread_id=43 created from a custom plugin? If so, which one? I don’t recognize that URL structure.

    @reartwebdesign

    Participant

    There’s a plugin called “BP Better Messages”

    @r-a-y

    Keymaster

    The problem is with BP Better Messages:
    https://wordpress.org/support/topic/404-if-user-isnt-logged-in/

    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:
    https://plugins.trac.wordpress.org/browser/bp-better-messages/trunk/inc/component.php#L170

    // 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.

    @reartwebdesign

    Participant

    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.

    @wordplus

    Participant

    Hi there everyone.

    Thansk @r-a-y, i will test this and include in next version of plugin.

    @winnischneider

    Participant

    Thanks. This code above works at me too.

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar