How do I redirect all the following URLs to “/” using single regular expression?
- members/kaleem/
- members/kaleem/activity/just-me/
- members/kaleem/activity/
- members/kaleem/activity/favorites/
- members/kaleem/activity/groups/
- members/kaleem/friends/
I am using it wordpress redirect plugin.
I’m not sure how WordPress’ redirect plugin works, but this regular expression will match all of above, as well as any other pages after
members/kaleem.Grab word characters, dashes, and slashes that appear after
members/kaleem. If there are certain pages aftermembers/kaleemthat shouldn’t be matched, it get’s more complicated. I was assuming that the examples you showed were part of a pattern.If you want to only match
kaleem/activityandkaleem/friends, plus any pages that are children of them, you can use this: