I wasn’t linking to the page correctly in the rewrite rules. The use of pagename was incorrect instead I should have used page_id. The rewrite rules I ended up using was
add_rewrite_rule('^resa/start/?$', 'index.php?page_id=1897&route_page=start', 'top');
add_rewrite_rule('^resa/planera/?$', 'index.php?page_id=1897&route_page=plan', 'top');
add_rewrite_rule('^resa/dela/([^/]+)/?$','index.php?page_id=1897&route_page=share&share_id=$matches[1]', 'top');
Related Posts:
- Why doesn’t flush_rewrite_rules run on plugin activation?
- Help With Rewrite_Rules For a Custom Plug-In
- rewrite URL based on selected taxonomy for post page
- Problem with dinamic add_rewrite_rule()
- add_rewrite_rule behaving strangely
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- Where, When, & How to Properly Flush Rewrite Rules Within the Scope of a Plugin?
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Custom frontend page for plugin without a ‘physical’ page?
- How to Rewrite WordPress URL for a Plugin
- permalinks with get variables
- WordPress plugin how to run function when button is clicked
- Plugin to Consume a Web Service
- Use an empty page to build custom plugin output
- External Rewrite Rules
- Add Post and Comments menu no longer visible
- Rewrite url for existing page without flush_rewrite_rules
- Does WP Have a Function To Generate .htaccess RewriteCond?
- Creating a path in a plugin to call a function
- URL rewriting must be activated manually for my plugin
- 404 errors after plugin options update and category base change
- How to restore WP 5.4 behaviour where a numeric string could added to each page URL and parsed as “page” in WP 5.5?
- How to change the URL pattern for single post view
- Custom url for a plugin page add_rewrite_rule WordPress
- Auto save permalink setting page with the plugin activation
- How To Consistently Enforce Rewrite Rule in Plugin Development
- Append varible to url or set session
- Adding rewrite rule dynamically
- How can I turn a custom wordpress page into a product page?
- WordPress Custom URL
- Remove custom post type slug from URL and add taxonomy Slug
- custom permalink’s rewrite rule for page id
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- How to grab query string from wp-content/uploads/.*
- Show content without a post
- How can I add rewrite rules to a class-based plugin?
- How to get post image root URL?
- How to create new content type and flushes rewrite rules without visiting the permalinks page?
- configuration of .htaccess for add_rewrite_rule to make sense
- Forward an old url rewrite scheme to a new one?
- Plugin architecture to pull from API & create dynamic content on WP site?
- Changing permalink structure breaks link to .php file which generates files dynamically
- wp_insert_post generated mixed permalinks
- Access to the template file of a plug-in
- Rewrite not working since upgrade to 5.9
- Custom post type change permalink query
- Home page is not loading, where in other pages are displaying on the site
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- WordPress Own Rewrite Rules
- Get the current post/page URL with plain permalinks
- Adding body class in author page for custom role
- Author Meta in Author URL Link
- WordPress plugin how to run function when button is clicked
- Using meta_key & meta_value in add_rewrite_rule
- Get (eventual) permalink from post within Edit Post in Admin panel
- Any way to make Apache’s internal redirect work?
- WordPress permalink setting
- How can I map a specific URL pattern to a plugin for processing
- Custom slug in url for CPT and taxonomy
- add_rewrite_rule not working
- How to Rewrite WordPress URL for a Plugin
- Virtual Page with Registration form
- Get URL of Post You Are Editing
- How to use permalink query to go to specific tabs in posts
- How to Rewrite WordPress URL for a Plugin
- URL rewrite parameter lost (add_rewrite_rule)
- Custom rewrite, url path with parameters to a page
- WordPress – Custom permalinks for advanced custom fields (ACF) using post type taxonomy
- Is wp-content/install.php a Drop-in?
- get_template_part from plugin
- Edit or Remove Plugin .htaccess Using The Admin Panel
- WordPress scheduled task is called but not executed
- How to create collections that are edited in admin?
- How to enable hierarchical permalinks for hierarchical taxonomies
- Use js script from one plugin in another plugin
- Build dynamic page from cURL (HTML page) response with plugin
- How to store accumulate multiple option values in a single array using Options_API
- template_redirect for single posts w/ custom fields
- can I prevent WP users (even admin) from deleting custom categories?
- Add specific word to default page permalink
- How to deal with equal & similar arguments for a function?
- What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?
- Callback is not called in add_settings_field() when passed as part of an array, but recognises that it’s there. It’s passed Class to Class using OOP
- Plugin translations not installed but… strings are translated!
- Secure Pages Best Practice
- Does wp_login only trigger before an user signs in into the admin panel?
- Declare plugin dependency [duplicate]
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Jquery was not found on this server
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- Working of foreach loop with array
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- WordPress Iframe for blog image
- Add the Twitter Bootstrap framework for the development of my plugins
- Convert each new line in the textfield as a new value in an array
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- Admin Message after Plugin Option Updated
- How Can I Retrieve post ID in plugin file
- ‘global’ not working when passing variable from plugin file to template
- get_template_parts() usage