Title: Redirect with if statement
Last modified: August 22, 2016

---

# Redirect with if statement

 *  Resolved [chatty24](https://wordpress.org/support/users/chatty24/)
 * (@chatty24)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/redirect-with-if-statement/)
 * Hi
 * I want to redirect from one page to another with the help of if statement in 
   functions.php
 * I am doing this for buddypress. Here is what I want :
 * if user is logged in and is on link “/notifications” then redirect to
 * “<?php bp_loggedinuser_link() ?>/notifications”
 * What I am trying to do is make a single link for buddypress dynamic links. So,
   if someone goes to “/notifications” he would be redirected to if own notifications
   page.
 * Can anybody tell me that how to write the above in form of code?
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [chatty24](https://wordpress.org/support/users/chatty24/)
 * (@chatty24)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/redirect-with-if-statement/#post-5675885)
 * Any ideas?
 *  Thread Starter [chatty24](https://wordpress.org/support/users/chatty24/)
 * (@chatty24)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/redirect-with-if-statement/#post-5676022)
 * BUMP!
 *  [TrishaM](https://wordpress.org/support/users/trisham/)
 * (@trisham)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/redirect-with-if-statement/#post-5676047)
 * You should be posting your question in the support forum for BuddyPress, not 
   here.
 * [https://buddypress.org/support/](https://buddypress.org/support/)
 * They should be able to help you over there. 🙂
 *  Thread Starter [chatty24](https://wordpress.org/support/users/chatty24/)
 * (@chatty24)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/redirect-with-if-statement/#post-5676079)
 * Thanks for replying TrishaM. If anybody else is trying to achieve the same thing
   then the answer is [here](https://buddypress.org/support/topic/using-redirect-to-make-single-link-for-buddypress-dynamic-links/)
 * Have a great weekend! 😀

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Redirect with if statement’ is closed to new replies.

## Tags

 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [chatty24](https://wordpress.org/support/users/chatty24/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/redirect-with-if-statement/#post-5676079)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
