Before flashing rules you have to add them:
public function activate() {
$this->add_rewrite_rules();
flush_rewrite_rules();
}
Related Posts:
- rewrite URL based on selected taxonomy for post page
- add_rewrite_rule behaving strangely
- How to Rewrite WordPress URL for a Plugin
- Rewrite url for existing page without flush_rewrite_rules
- URL rewriting must be activated manually for my plugin
- How to change the URL pattern for single post view
- How To Consistently Enforce Rewrite Rule in Plugin Development
- Help With Rewrite_Rules For a Custom Plug-In
- Adding rewrite rule dynamically
- Problem with dinamic add_rewrite_rule()
- Remove custom post type slug from URL and add taxonomy Slug
- 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
- Forward an old url rewrite scheme to a new one?
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- Custom post type change permalink query
- Add variables from rewrite rules to query var
- 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 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
- remove “index.php” from permalinks
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Custom rewrite rules for archive page and single post
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom frontend page for plugin without a ‘physical’ page?
- Make post slug have priority over category slug
- permalinks with get variables
- Permalink rewrite with custom post type and custom taxonomy
- Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions
- Removing rules from .htaccess
- Mapping multiple URLs to same page
- flexible rewrite ‘ramble’ URLs with WordPress
- Permalinks for CPT breaks permalinks to pages
- How to Modify Existing Rewrite Rules?
- 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 set up Author archives with sub category URL
- Custom url for a plugin page add_rewrite_rule WordPress
- remove sub-category of Custom Post Type from permalink structure
- WordPress add_rewrite_rule() cannot visit lower url levels
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- How to change custom post type permalink structure
- Custom permalinks with hierarchical taxonomy – getting PHP warning
- How can I turn a custom wordpress page into a product page?
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- How to remove specific category from URL in WordPress
- Changes in permalink structure in WordPress and how to apply to in-site links
- Custom Permalink to remove category word , keeping posts permalink with date?
- Custom permalink leads to index page
- Permalinks only for posts
- custom permalink’s rewrite rule for page id
- Custom rewrite rule ignored
- How to change url for taxonomy pages?
- Set parent for custom post type archive rewrite url
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- How can I set up a secondary permalink structure?
- wp_insert_post generated mixed permalinks
- How to Use metada Value in Url and is it possible? [duplicate]
- Custom Path for a Plugin
- Safest way to create a custom permalink
- Custom WooCommerce rewrite rules with comma delimiter
- Rewrite not working since upgrade to 5.9
- rewrite based slug standar post wp
- remove SLASH on single_post but KEEP on categories and parent pages
- How do I get the correct URL?
- 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
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- WordPress custom url without using any of the custom tags given
- Add slug to default post permalinks ONLY
- Adding body class in author page for custom role
- How to add rewrite rule for product compare page?
- Remove “category” from permalink with add_rewrite_rule
- Permalink structure /page/page/cpt-post gives 404 with pagination
- How to force download a plugin generated file?
- Rewrite posts url as they’re all children of a page
- a way to support totally different url structure
- Multiple Permalink Patterns for one page
- Pretty Filter URL
- Get (eventual) permalink from post within Edit Post in Admin panel
- Fixing the WP Post Object for Custom Route
- WordPress permalink setting
- Prevent guessing slug
- How can I send an id over the url?
- Apache rewrite rules and wordpress problem
- WordPress permalink still not working (error or not understood?)
- Mapping multiple URLs to same page
- Use custom clean URLs for a plug in
- redirect word-press page with page values
- Add additional URL variations for a Post
- What is the best way to relate different custom post types?
- Cannot use dynamic prefix for WooCommerce permalink