The URL is then example.com/myslug (where myslug is the
permalink from the page). There is no model parameter however.
That happens because you used the wrong parameter for the Page ID:
The p parameter corresponds to a fixed page ID I have created.
So actually, for the page
post type, i.e. Pages, you should use page_id
and not p
. See the documentation for more details.
So you just need to replace the index.php?p=
with index.php?page_id=
and your rewrite rule will work correctly, but remember to flush the rewrite rules manually via the Permalink Settings admin page. (Simply visit the page and WordPress will automatically flush the rules without you having to click the Save Changes button)
Related Posts:
- How to Rewrite WordPress URL for a Plugin
- Rewrite url for existing page without flush_rewrite_rules
- How to change the URL pattern for single post view
- Why doesn’t flush_rewrite_rules run on plugin activation?
- How To Consistently Enforce Rewrite Rule in Plugin Development
- Adding rewrite rule dynamically
- rewrite URL based on selected taxonomy for post page
- add_rewrite_rule behaving strangely
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- How can I add rewrite rules to a class-based plugin?
- configuration of .htaccess for add_rewrite_rule to make sense
- Custom post type change permalink query
- Using meta_key & meta_value in add_rewrite_rule
- Any way to make Apache’s internal redirect work?
- 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
- How to Rewrite WordPress URL for a Plugin
- A tool to analyze rewrite rules? [closed]
- Custom pages with plugin
- Making a plugin file accessible via url rewrite?
- Add rewrite rule to permalink structure
- Custom frontend page for plugin without a ‘physical’ page?
- add_rewrite_rule, plugin activation and plugin deactivation
- Custom Rewriting to Plugin with Parameters
- Plugin to Consume a Web Service
- Filter to change the content of 404 page
- Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions
- Removing rules from .htaccess
- Mapping multiple URLs to same page
- External Rewrite Rules
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Does flush_rewrite_rules() remove all rules added by other plugins as well as mine?
- Add_rewrite_rule doesn’t add custom url in plugin
- Does WP Have a Function To Generate .htaccess RewriteCond?
- Custom rewrite rule serves content, but returns 404 error code
- flush_rewrite_rules() not working on plugin activation
- URL rewriting must be activated manually for my plugin
- 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?
- Redirect traffic to plugin
- Custom url for a plugin page add_rewrite_rule WordPress
- Append country to ‘pretty’ url but serve same page
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- Help With Rewrite_Rules For a Custom Plug-In
- WordPress Custom URL
- Problem with dinamic add_rewrite_rule()
- Remove custom post type slug from URL and add taxonomy Slug
- Help writing custom function with rewrite endpoint that generates a page from dynamic content
- Possible to get all posts with my shortcode?
- Create page (not the post type) dynamically
- How to grab query string from wp-content/uploads/.*
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- Plugin Development – Get Admin Url (Including cases where wp-admin is not used)
- Forward an old url rewrite scheme to a new one?
- Plugin architecture to pull from API & create dynamic content on WP site?
- Rewriting Image URLs from dynamic to original
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- Custom Path for a Plugin
- Access to the template file of a plug-in
- Rewrite not working since upgrade to 5.9
- Add variables from rewrite rules to query var
- Change cannonical URL after changing url with add_rewrite_rule()
- WordPress rewrite rule depend on meta values not ids
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin
- WordPress Own Rewrite Rules
- WordPress custom url without using any of the custom tags given
- How to force download a plugin generated file?
- How to pass a more variable with page/subpage in Wordprees URL?
- Custom pages with plugin
- Rewriting URLs with a query string
- How can I map a specific URL pattern to a plugin for processing
- How can I send an id over the url?
- Apache rewrite rules and wordpress problem
- Mapping multiple URLs to same page
- Use custom clean URLs for a plug in
- How to use permalink query to go to specific tabs in posts
- redirect word-press page with page values
- Custom rewrite, url path with parameters to a page
- How can I add an option to the Page Template list from a Plugin?
- Make post slug have priority over category slug
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- Scheduled event does not run at midnight
- Woocommerce add custom button to backend order table
- What is rich_editing?
- Is it possible to delay execution of shortcode output callback?
- Rewrite URL – insert custom variables as a directory path
- wp_enqueue_script + wp_enqueue_style Since When
- Is there any way to allow a plugin to write over a previous version?
- How do i validate data entered in a meta box so that only floats can be entered in a field?
- Search: how to extend the existing search to include a custom table
- Plugin development: delete options when updating to a new version
- Custom code for WordPress dynamic menu
- How to get all queries’s results after they have executed?
- How add default term meta to prevent an error?
- Insert, update or remove data from database (usermeta)
- Can a plugin differentiate syndication feeds from actual site views?
- Plugin settings checkbox
- WordPress Beginer to Guru [duplicate]