In response to yivi’s inquiry, So I was able to solve the problem by putting the hardcode portion of the redirect string first as shown here:
add_rewrite_rule(
"{$list_view_template}/(.*)?",
'index.php?mlscrit=/list-view/$matches[1]&pagename=" . $list_view_template,
"top'
);
Thanks!
Related Posts:
- Rewrite rules and query for virtual page
- add_rewrite_rule permalinks break in WordPress 4.5
- Rewrite Rule for Post Meta
- WordPress add a rewrite rule to a page to accept a GET variable
- Custom Fields Query Vars and Rewrite not working
- Last query_var not working with rewritten URL
- How to use endpoint, but remove/rewrite endpoint base?
- Passing variables in the permalink structure on a custom post type
- How to check if a rewrite rule exists
- Custom post types and custom variables — add_rewrite_tag() question
- WordPress Custom URL Rewrites
- Case-insensitive add_rewrite_rules in WordPress functions
- Does add_rewrite_rule(..) only accept “index.php” as redirect target?
- add_rewrite_rule not working for page var
- Cyrillic characters in rewrite rules cause 404 Not Found errors
- Custom Endpoint Gives 404 Header
- Clean URLs for custom $_GET variables
- Pagination Doesn’t Work
- Custom Rewrite with Query vars
- Separate posts by chapter per rewrite
- resolve /author/ to a page or archive (of all authors) template
- Multiple values in a rewrite rule, is it possible?
- add_feed and flush_rewrite_rules
- WordPress rewrite rules for state and city
- add_rewrite_rule parameter is not received by the page
- How to Modify Existing Rewrite Rules?
- Change Theme from Plugin based on query_vars
- Best action to call add_rewrite_rule
- get_query_var with add_rewrite_rule and add_filter(‘query_vars’) not working
- Reading Settings -> Front Page displays “Static Page” being reset
- add_rewrite_rule isnt working, not getting added to rules array, why?
- Associate the “add_rewrite_endpoint” and “$_GET”
- Custom Rewrite rule to match anything not already matched by WordPress
- Add Rewrite Endpoint to CPT Archive
- how to add rewrite rule to wordpress default post type
- Custom query var rewriting with only variable
- 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()
- Custom rewrite_rules – only pass numbers and not alphabetic characters
- 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
- Custom taxonomy rewrite with query var returns %2F in URL
- rewrite url in wordpress
- 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
- How to flush rewrite rules on the activation of any plugin
- $wp_rewrite->rules is always NULL
- Rewrite without query parameter
- WordPress CPT slug and page slug conflicts
- Mod_rewritte – remove ?m=1 from url
- help with custom rewrite rules
- WooCommerce – Conditional for page created by rewrite_rule
- custom permalink for single post category
- Rewrite rules priority
- Rewrite rules ignored
- add_rewrite_rule issues
- Add_rewrite_rule doesn’t seem to work?
- Custom post types and custom variables — add_rewrite_tag() not working
- Grab last part of the url inside rule
- Leverage WP_Rewrite to pre-validate links / detect invalid links
- When request has multiple matching rewrite rules, and matched rule returns 404 – iterate to next rewrite rule
- “/” URLs without trailing slash shows 404
- How to allow WordPress to recognize a custom URL segment after a product URL and use a custom template?
- CPT – Nice url with add_rewrite_rule
- add_rewrite_rule not working for blog category page
- get_author_posts_url() doesn’t return the author URL, because of wrong author_structure
- add_rewrite_rule only works when flush first
- Homepage rewrite rule
- WordPress pass url to page template when page does not exist
- custom rewrite rules will not be added to wordpress rewrite_rules database
- rewrite rules problem with #comments-2345
- Overcoming a complex WordPress page rewrite rules request
- Why isn’t my rewrite rule for add_rewrite_rule not working as expected?
- A part of regular expression in add_rewrite_rule function not working
- Prevent WordPress to remove query vars from url
- Taxonomy Rewrite Problem
- how to use mutliple add_rewrite_rule?
- Pretty Filter URL
- Social sharing conflict with Rewrite rules
- Rewire Rules Front Page
- WordPress URL rewrite after changing web from Joomla
- Connect custom rewrite rules and query variables to wordpress navigation
- add_rewrite_rule doesn’t work for me
- Rewritten URL not loading WordPress environment
- Changing default slug of post to the post id
- Rewriting base name Taxonomy same Post Type
- Where to hook to bypass instantiating WP_Query?
- How to Add Rewrite Ruled Argument Into Permalink Properly
- Overwrite WP’s default search rule to redirect to my own template
- Add additional URL variations for a Post
- Rewrite rule to index.php in theme subfolder
- `query_var` values empty in theme file after `add_rewrite_rule` redirection
- How does WordPress manage to differentiate between post and page URLs without a distinct base, and how can I replicate this functionality?