title: How to redirect logged users to a custom page in buddypress & wordpress
body: <p>I am trying too redirect every logged users to a specific page of their profile...See this example page..
  this site is build on wp and bp. I am using BP Profile as Homepage plugin for logged in user redirection...
  this see this code ...</p>
  
  <pre><code>function bp_profile_homepage()
  {
     global $bp;
     $selected_role = get_option('bpahp_role_choice');
     if($selected_role == '')
     {
         if(is_user_logged_in() &amp;&amp; bp_is_front_page())
         {
              wp_redirect( $bp-&gt;loggedin_user-&gt;domain );
         }
     }
     else
     {
         if(!current_user_can($selected_role) &amp;&amp; bp_is_front_page())
         {
  
              wp_redirect( $bp-&gt;loggedin_user-&gt;domain );
         }
     }
  }
  </code></pre>
  
  <p>So after using this plugin i am able to redirect my user to their profile page automatically when they logged in..
  <a href="http://www.example.com/members/admin/" rel="nofollow">http://www.example.com/members/admin/</a></p>
  
  <p>but i want to redirect them to this page</p>
  
  <p><a href="http://www.example.com/members/admin/activity/all-activity/" rel="nofollow">http://www.example.com/members/admin/activity/all-activity/</a></p>
  
  <p>All activity is a sub page of activity directory in which i am showing all activities to users sitewide..
  i do not want to send them on site wide activity page for seeing activity i want to show them all that on their profile page..</p>
  
  <p>So any idea what to add in this code
     wp_redirect( $bp->loggedin_user->domain );</p>
  
  <p>to make it workable with my requirement....
  I have tried so many tricks for making my requirement workable but do not get success..i have also tried to replace this code </p>
  
  <pre><code>wp_redirect( $bp-&gt;loggedin_user-&gt;domain );
  </code></pre>
  
  <p>with this one...
      $redirect_url = "$bp->loggedin_user->domain/activity/all-activity/";<br>
              wp_redirect( $redirect_url );</p>
  
  <p>And this one</p>
  
  <pre><code>$redirect_url = "activity/all-activity/";   
      wp_redirect( $bp-&gt;loggedin_user-&gt;domain/$redirect_url );
  </code></pre>
  
  <p>Nothing is working
  Please somebody help me..</p>