If you’re trying to catch the pattern ‘/forums/user’, you could use PHP’s stringpos function. Something like this should capture what you’re looking for:
$url_pattern = "/forums/user";
$requested_uri = $_SERVER["REQUEST_URI"];
if(strpos($requested_uri, $url_pattern) == 0){
//Your code goes here
}
Make sure if you have “enforce trailing slashes” set that you use “/forums/user/” as your matching pattern instead. This code isn’t tested but should work.
Related Posts:
- How do I to override login redirect on specific pages?
- How to keep plugin translations after updates?
- Redirection plugin – how to let the editor access the ‘redirection’ menu?
- SSL redirect loop using WordPress HTTPS Plugin
- Redirection Plugin: Redirect all URLs with a regular expression
- How can I pass a variable to wp_ajax action?
- flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
- Can Not Redirect from Plugin-Registered Admin Page
- Detecting $_GET parameters from any page + Cookie
- How to send “Location” header on plugin form submit event?
- Custom url structure for custom template
- wordpress custom login successful redirect hook
- Can’t access my WP dashboard: fatal error? [closed]
- How to redirect Old Post URL to new Post and keep Old post Comments?
- What’s the _wp_desired_post_slug value for?
- Redirect all blog links from WordPress.com site to new domain
- Why does deactivating a plugin cause error: “You do not have sufficient permissions to access this page”?
- how can I link to a PlugIn admin-sub-menu page after processing a formular
- How does automatic redirection for the redirection plugin work?
- Changed permalink structure. Need help with redirecting old posts
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- Landing Page Redirect Chain | http->https->https www
- Redirection based on location but without affecting search bots
- Page Restriction and Redirect for Particular Levels or user
- how to create site exit messages with destination url displayed
- How to redirect a URL with parameters?
- WordPress Shortcode to get URL Parameters $_GET[‘name’] redirects for no reason at all
- Redirecting a buddyboss profile tab to a different tab if not subscribed to a specific membership
- Redirect already logged in users away from a page to a specific page base on user role
- How to fix the woocommerce – adaranth.com redirection issue [closed]
- WordPress change Language not working
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- BbPress Register Page in Breadcrumbs
- bbPress plugin: forum lists not showing in correct order? [closed]
- How to use login_redirect with a user capability
- Removing Automatic Redirects Without Plugin
- Duplicate New User Registration notices (BuddyPress and bbPress both installed)
- WordPress 4.3 broke meta redirect (with url params plugin)
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- Mask and Track Outbound Links
- How can I redirect some pages to new subdomain? [closed]
- Add to array, redirect and display
- Conditional custom redirect
- how to set parent forum link to menu page?
- Making the ‘add to cart’ button redirect to PayPal
- How to completely hide a WordPress/BuddyPress Install? [closed]
- How do I determine if the user who registered is not spam?
- PHP mobile redirect Endless loop
- How to force load a page in plugin?
- wp redirect 301 not working in wordpress page
- Preserve Search engine index while shifting to new Domain
- Janrain/Simple Modal under Redirected Domain
- Redirect unloggedin users
- login form should redirect to register page for in 1st login next time it should redirected to home page
- Identify User Language, Redirect to the corresponding page and Save the chosen language as Cookie
- www redirects to another directory in wordpress
- Hidden permalink different from displayed permalink
- redirect to homepage once action is completed
- Display value of the GET parameter in a new URL page
- Redirect to a page while maintaining search query parameters without causing an infinite loop
- Can’t add new plugin or themes on a wordpress multisite network from the primary site as administrator. Error: ERR_TOO_MANY_REDIRECTS
- How to update all in-site redirect URLs to destination URLs at once
- How to send new visitor to a splash page for only one time in wordpress?
- WordPress Admin login redirect to homepage
- return bbp_get_topic_author_id as integer
- Why is my site still showing insecure icon even if I have SSL certificate?
- Forum creation with bbpress and front end
- Reverse count page view and show on other page
- redirect to a custom page
- .htaccess file doesn’t work, with hundred tries
- Identify if the_post hook is being called from the admin post list
- Infinite 301 redirects after definitions in “Redirections” plugin?
- Clone a Post Tite and Custom Field into Custom Post type
- Direct URL to a template via plugin
- How to redirect from plugin page
- Template redirect inside of plugin not redirecting
- Can’t redirect to previous page after using GET
- Need to change contact email depending where user is from
- Redirect url in plugin to somewhere else?
- phpBB 3 to bbPress
- How to link that “logged in” in “you must be logged in to post a comment” with custom login page on WordPress?
- Simple WordPress function / plugin to redirect a site
- URL Redirect on GoDaddy platform [closed]
- Redirecting to page on form submit – Revue plugin
- how to make wordpress remember my choice
- Remove embed url for internal links
- Page with redirect
- How to create a buddypress group automatically if a topic is created
- Uncaught Error: Call to undefined function wp_generate_attachment_metadata() @ wp-cron
- How to call “page specific menu items” in template [closed]
- wp_enqueue_style in Plugin [duplicate]
- Not able to open category post [closed]
- Removing customise fields during plugin uninstallation
- plugin class inheritance. cannot change variable
- Delay JavaScript files from loading
- Multisite Change from domain.com to sub.newdomain.com
- Remove Keywords From Webpage But Still Use for SEO
- My WordPress activation hook isn’t working
- Include paths and functions for external scripts
- Postal address auto-complete on profile page