• Resolved puckettventures

    (@puckettventures)


    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.

    Any help would be greatly appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator James Huff

    (@macmanx)

    I recommend asking at https://buddypress.org/support/ so the BuddyPress developers and support community can help you with this.

    Thread Starter puckettventures

    (@puckettventures)

    Thanks. As a side note. I fixed this by adding the following lines to wp-includes/class-wp.php

    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();
    Moderator James Huff

    (@macmanx)

    Thanks for sharing your solution!

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