I'm using the wpForo plugin to create custom profile pages on the front end of my website.

The profile URLs generated by the wpForo plugin look like this:



I managed to rewrite these URLs internally by editing some of the core plugin files. (Yes, I know, very dirty.) Now these urls looks like this, but they obviously lead to non-existing pages, showing a 404 error.



Can I use WordPress's rewrite rules to basically display the wpForo profile page on the edited URLs? I tried the following, but it doesn't work.

function custom_wpforo_rewrite_urls() { 
    // Regex returns these matches

        0 = community/profile/username/
        1 = profile
        2 = username

    add_rewrite_rule('/community\/(.*)\/(.*)\//', 'user/$matches[2]/$matches[1]', 'top');

} add_action('init', 'custom_wpforo_rewrite_urls');

Which should result in the following URLs working... But they don't.



  • you're using a mix of internal and external rewrites format- internal rewrites must point to index.php and set the necessary query vars to result in a successful main query.
    – Milo
    Commented Oct 17, 2016 at 15:18
  • @Milo So just for clarification. Do I need to use an internal or an external rewrite format to get the desired effect?
    – Swen
    Commented Oct 17, 2016 at 16:04


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.