s2member allows for both free and paid levels (up to 4), and you can get really creative with what you want to restrict; from simple URIs to custom conditionals, and all the way to a whole bunch of hooks & filters to play with. Oh,and it works just fine with BP. Just be sure to read the documentation… there’s a lot!

// Still here? Okay, then redirect to the login form
auth_redirect();
}

// Use some deprecate code (yeah, I know) to insert a “You must login” error message to the login form
// If this breaks in the future, oh well, it’s just a pretty message for users
function LoginFormMessage() {
// Don’t show the error message if anything else is going on (registration, etc.)
if ( ‘wp-login.php’ != basename($_SERVER) || !empty($_POST) || ( !empty($_GET) && empty($_GET) ) ) return;

@r-a-y is there any method of testing whether the page concerned is a root component, that is the page lives in the root directory e.g example.com/groups/

reason for asking is as the plugin stands anonymous users only ever see a login page, that can tend to put people off? they may base their decision to join based on what they see going on on the site to that end my preferred approach (or at least a further angle to take in restricting access) is to allow visual access to all top level pages but not deeper into the site.

I had thought that one could check on whether a page is a root component but can’t track that down, I can take various steps to getting closer to this by adding bp_is_front_page() to the :if (bp_is_register_page() || bp_is_activation_page() || bp_is_front_page() ) and could add is_page(‘wp page’) for blog created pages – although oddly a page created to act as the blog page while setting front page to say ‘activity stream’ doesn’t appear to work??

Also of course one can add directory paths to the exclusion array:
$this->exclusions = array(
'wp-login.php',
'wp-signup.php',
'/wp-content/themes/child-theme-name/groups/'

But that isn’t best approach as it fails if one changes themes and child themes override bp-default so one can’t set that if suing child themes.

Overall and ideally a check to see if the page/directory/componant lived at root level would seem the best approach.

@r-a-y great update for the ruo2. question for you.. i have added bp_is_front_page() to the if line.. which allows me to show the Home Page (and the Register Page redirect for everything else).. but i also need to add one more page for non-registered users to view… can i call it out specifically by name or what is the best method?