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
- How to debug a plugin with Xdebug?
- How to Structure a New Role/Capability Scheme?
- How to create Image gallery Metabox in wordpress [closed]
- Is it possible to create an action hook using do_action() within add_action()?
- WordPress 2.8 Widget API is suitable for Worpress 3.1.4 plugins development?
- Need specific kind of “Poll Voting” for WordPress [closed]
- Plugin admin page meta_box toggle and order state not saving
- Is there a better way to implement responsive images than what WordPress uses by default?
- Use WP_Theme::scandir function to scan a plugin directory. Is there a way?
- Plugin options not being saved or created
- Change the ‘published on’ text?
- How to get boolean value from register_meta properly?
- Gravity Forms Perks – Nested Forms
- AJAX form post returns 0
- Update wordpress Core Remotely
- Proper way to use useSelect
- Access to apache logs from plugin
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- Translating plugin settings page – dropdown list
- Hide one specific woocoomerce product
- wp_schedule_single_event is set correctly but sometimes not fired
- wp.media gallery collection sometimes undefined
- GET request return value as error instead of success
- How to update global variables in plugin activation callback?
- How to include a page template and template part into my plugin
- How Can I Create a Friendly Slug for a Dynamic Page?
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- Custom Permlinks work, regular page permalinks don’t
- Custom Post Types and rewrite rules – One CPT works and a cloned one doesn’t
- problem with blank page
- Plugin SVN folder structure
- Return custom product in ajax call loop