Skip to:
Content
Pages
Categories
Search
Top
Bottom

Getting 404 after visiting activity stream in buddypress


  • puckettventures
    Participant

    @puckettventures

    Continuing thread from wordpress.org:

    Anytime I navigate to the activity feed on buddypress and then back to a main page in my navigation I receive a 404 page not found. I can reset the issue by re-saving permalink settings.

    After troubleshooting I discovered that the in the wordpress parse_request function, a different rewrite rule is being matched when it breaks. When it is not working the regexp ([^/]+)(/[0-9]+)?/?$ is matched.

    request uri:string(21) “mindfulness-resources”

    new match: ([^/]+)(/[0-9]+)?/?$ Query: index.php?name=$matches[1]&page=$matches[2]array(2) {
    [0]=>
    string(21) “mindfulness-resources”
    [1]=>
    string(21) “mindfulness-resources”
    }

    When it is working the same block returns the output below and (.?.+?)(/[0-9]+)?/?$ is matched.:

    request uri:string(21) “mindfulness-resources”

    new match: (.?.+?)(/[0-9]+)?/?$ Query: index.php?pagename=$matches[1]&page=$matches[2]array(2) {
    [0]=>
    string(21) “mindfulness-resources”
    [1]=>
    string(21) “mindfulness-resources”
    }

    The only two differences I can detect is that the rewrite array order is different for these two rules and when its working the (.?.+?)(/[0-9]+)?/?$ rule is higher and thus encountered by the rule matching loop first. I have not been able to find the reason the order changes.

    I fixed this by adding the following lines to wp-includes/class-wp.php which is not an ideal solution

    if(isset($rewrite['([^/]+)(/[0-9]+)?/?$']))
    		{
    			$temp = $rewrite['([^/]+)(/[0-9]+)?/?$'];
    			unset($rewrite['([^/]+)(/[0-9]+)?/?$']);
    			$rewrite['([^/]+)(/[0-9]+)?/?$'] = $temp;
    		}

    right after the line below in the function parse_request().

    // Fetch the rewrite rules.
    $rewrite = $wp_rewrite->wp_rewrite_rules();
Viewing 4 replies - 1 through 4 (of 4 total)
  • What is the “mindfulness-resources” page — do you have that set as the home page for your site, or is it mapped to one of the BuddyPress components (which one)?

    It would also be useful to know what plugins and themes you have on your site. I wonder if something’s messing with the rewrite rules, we can try to help you figure it out.


    KeithMon
    Participant

    @keithmon

    I’m experiencing the same issue. After I visit BuddyPress pages and then navigate to any standard or template page, except the homepage, but including the blog, I get a 404. Sometimes a simple refresh will work. Sometimes navigating to a new page will work. Sometimes the issue will not be fixed unless I refresh Permalinks or log-out and log-in again.

    WordPress 4.2.2
    BuddyPress 2.2.3.1
    bbPress 2.5.7 (though, the issue continues even when bbPress is deactivated)

    This issue was asked on another post that was closed before an answer was provided:
    https://buddypress.org/support/topic/buddypress-iis-and-randomreoccurring-404-errors/

    This post had a resolution:
    https://buddypress.org/support/topic/page-not-found-error-on-static-pages/

    I have checked and Mod_Rewrite is enabled through htaccess as defined here:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /higher/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /higher/index.php [L]
    </IfModule>
    # END WordPress

    Am I missing anything here? This appears to be an issue with BuddyPress. Does anyone have a resolution?


    djsteveb
    Participant

    @djsteveb

    every time this happens to me, I go to permalinks settings, note what they are.. change permalinks to something else.. save.. then go back to permalinks, change back to what I had originally. Save again. Problem fixed.

    I have no idea if this is the same issue you are having. This happens to me 2 out of 3 times that I update the rtmedia plugin.


    KeithMon
    Participant

    @keithmon

    I just tried the work-around (hack) provided by @puckettventures and it does solve the issue. However, this is not ideal because those changes will be lost on update.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Getting 404 after visiting activity stream in buddypress’ is closed to new replies.