doesn’t it work get_query_var('u')
to grab the variable ?
Also you need to use – "index.php?pagename=search-result&u=". '$matches[1]'
, single quote surrounding $matches[1]
.
Related Posts:
- Querystring parameter getting lost in rewrite rule
- Custom post types and custom variables — add_rewrite_tag() question
- WordPress Custom URL Rewrites
- Does add_rewrite_rule(..) only accept “index.php” as redirect target?
- Cyrillic characters in rewrite rules cause 404 Not Found errors
- Custom Endpoint Gives 404 Header
- Clean URLs for custom $_GET variables
- Making extra parameters optional
- why is are these rewrite_tags and rules not working?
- Redirect taxonomy to custom template to list terms in taxonomy
- How to change the matches in add_rewrite_rule
- resolve /author/ to a page or archive (of all authors) template
- Multiple values in a rewrite rule, is it possible?
- What add_rewrite_tag()’s RegEx matches against?
- add_rewrite_rule() not working
- add_feed and flush_rewrite_rules
- Rewrite rules and query for virtual page
- Best action to call add_rewrite_rule
- add_rewrite_rule isnt working, not getting added to rules array, why?
- add_rewrite_endpoint not working
- Associate the “add_rewrite_endpoint” and “$_GET”
- Custom Rewrite rule to match anything not already matched by WordPress
- How to use rewrite rule or rewrite endpoint to switch languages?
- Remove rewrite endpoint on deactivation?
- Do I need to flush rewrite rules when creating new user if using custom author rewrite rules?
- Add Rewrite Endpoint to CPT Archive
- Optional all capture groups in rewrite rule
- Rewrite rule : custom post type with 2 numeric variiables
- Does it still make sense using json endpoint ep_mask now that there’s the new rest api? [closed]
- Simple page URL rewrite with add_rewrite_rule()
- Optimal code for two add_rewrite_rule’s
- Custom URL rewrites work, but break my permalinks
- add_rewrite_rule – Additional subpages for author pages
- How do I flush rewrite rules
- Pass query vars to front page
- rewrite url in wordpress
- Making extra parameters optional
- My add_rewrite_rule is returning a 404
- Rewrite rule for path of favicon.ico ( Add_rewrite_rule function possible ? )
- wordpress add_rewrite_rule not working
- FLUSH_REWRITE_RULES – after or before REGISTER_POST_TYPE?
- Using get_query_var() from a plugin
- force_ssl_admin() causing issues with preview links
- $wp_rewrite->rules is always NULL
- WordPress CPT slug and page slug conflicts
- Mod_rewritte – remove ?m=1 from url
- help with custom rewrite rules
- Order of rewrite rules when calling add_rewrite_rule
- Rewrite Rule for Post Meta
- add_rewrite_rule() not stored (I think)
- custom permalink for single post category
- WordPress add_rewrite_rule second argument not working
- WordPress rewrite does not work for some reason
- Rewrite rules ignored
- Adding a custom rewrite rule for gallery/categories page
- add_rewrite_rule issues
- Add_rewrite_rule doesn’t seem to work?
- add_rewrite_rule to search
- Why isn’t my rewrite rule working when there is no second parameter?
- Rewrite rules applied differently after upgrade
- Leverage WP_Rewrite to pre-validate links / detect invalid links
- How to do make mysite.com/post-name/sub-post?
- Custom rewrite rules for a page with GET variables?
- Is it possible to add a site-wide add_rewrite_rule for a multilingual site?
- When request has multiple matching rewrite rules, and matched rule returns 404 – iterate to next rewrite rule
- WordPress – replicate same globals, query vars and query for an alternate endpoint
- add_rewrite_rule not working for blog category page
- get_author_posts_url() doesn’t return the author URL, because of wrong author_structure
- rewrite rule not working: redirect to php script if file exists
- Homepage rewrite rule
- rewrite rules problem with #comments-2345
- Rewrite post type into a page with year filter
- How to create a custom URL to another domain in WordPress
- Why isn’t my rewrite rule for add_rewrite_rule not working as expected?
- WordPress matching URLs with trailing tildes code correction
- Pretty links with add_rewrite_rule and add_query_var
- A part of regular expression in add_rewrite_rule function not working
- Flush rewrite rules when every page gives 500 error?
- Using add_rewrite_rule in conditional statement using $_SERVER
- How to change URL in WordPress
- WordPress Rewrite rule with custom query var
- default ‘post’ post type: not forcing url rewrite when args set
- Complex rewrite rules with multiple variables, some the same
- how to use mutliple add_rewrite_rule?
- Social sharing conflict with Rewrite rules
- Rewire Rules Front Page
- WordPress URL rewrite after changing web from Joomla
- Adding custom slugs: parent-page/username/child-page/
- Changing default slug of post to the post id
- How bad is flush_rules() on init hook?
- Where to hook to bypass instantiating WP_Query?
- Rewrite for page with a possible unknown parent page
- Passing variables in the permalink structure on a custom post type
- WordPress Rewrite Rules
- add_rewrite_rule with trailing slash redirects
- nginx + W3 Total Cache: rewrite rules issue [closed]
- Custom URL rewrite with add_rewrite_rule
- Rewrite rule to index.php in theme subfolder
- WordPress rewrite rule – not able to access second and third parameters
- Custom URL Rewrite Rules not working