You need to flush rewrite rules after adding or modifying rewrite rules in WordPress.
flush_rewrite_rules()
can be used to flush rules.
For more info check these links :
https://codex.wordpress.org/Rewrite_API/add_rewrite_rule
https://codex.wordpress.org/Function_Reference/flush_rewrite_rules
Related Posts:
- Custom url rewriting
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- Apache rewrite rules and wordpress problem
- Custom pages with plugin
- Add rewrite rule to permalink structure
- Add Rewrite Rule for custom page
- add_rewrite_rule, plugin activation and plugin deactivation
- flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404
- Custom rewrite rule is not picked by WordPress
- Add .html extension to custom post type taxonomies
- 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
- How can I rewrite a plugin generated URL?
- flush_rewrite_rules() not working on plugin activation
- WordPress custom URL Rewrites redirecting not masking
- How does WP handle multiple matching rewrite rules?
- Custom rewrite rules not working with WPML
- How to Create a Custom Slug for Tags and Categories with a prefix or suffix?
- Redirect to another page using contact form 7? [closed]
- Remove .htaccess portion upon plugin deactivation?
- Edit Permalink Structure For Custom Post Type or Modify .htaccess?
- URL rewrite with external JSON query
- i want to rewrite my custom plugin url
- can’t install any wp plugins [duplicate]
- add_rewrite_rule to load different page, without changing URL in browser
- WordPress rewrite rule depend on meta values not ids
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- Change custom rewrite rule when permalink is updated/changed
- URL Rewrite 404
- Custom pages with plugin
- How To Rewrite WordPress Pages URL Only?
- WP Job Manger change jobs url (NOT slug)
- Please Check this ‘.htaccess’ File
- How to rewrite URL using .htaccess in WordPress Plugin
- admin-ajax.php warning max input vars exceeded on layered pop plugins [closed]
- Reoccurring 404 Errors on all subpages
- Problem with Author page redirect
- Multisite theme path rewrite using .htaccess
- Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
- WordPress keeps writing rewrite rules to .htaccess
- Customise particular RSS permalink
- plugin links not working [closed]
- URL rewrite of independent plugin?
- Plugin generated taxonomies’ permalinks with custom placeholders
- RSS feed rewrite matching wrong rule
- WordPress add_rewrite_rules for custom URLs ending in .html
- Locked out of admin panel after installing HC Custom WP-Admin URL [closed]
- How to customize a title by passing query string?
- WordPress plugin url for form submit
- Creating author Specific page URL
- rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked
- Rewrite specific action url
- Username Variable in custom links?
- .htaccess file doesn’t work, with hundred tries
- I am trying to rewrite urls in WordPress, but its not working
- htaccess question and plugins.php
- Help Code Review – I need to write on .htaccess file from theme’s function.php
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- How to add subdomain to htaccess
- Get custom term link archive with prefix
- How to regenerate slugs for categories and tag converting non-Latin characters?
- Change default url to plugin custom post type
- Rewrite in plugin
- add_external_rule – rules deleted when visiting permalinks page
- How to disable wordpress page rewrite rule?
- Site not displaying correctly when re-directing from root to sub-directory
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Creating custom URL for async content
- URL RewriteRule doesn’t work when using WP Database Participants in my WordPress website
- Custom shortcode with dynamic rewrite
- Rewrite URL to plugin file
- How to programatically create a simple HTML page using the permalink of a WordPress post?
- Change Admin URL
- custom url with custom post
- How to remove post redirects
- Migration from old CMS to WordPress 301 redirection rules?
- How to get the parameters on page and avoid 404?
- URL Rewriting from a Plugin based on custom values
- How to create custom content on custom page from plugin?
- How can I process all requests for a given directory in a URL with my plugin?
- Additional .htaccess rules based on wp page
- incorrect path of plugin dir on network
- What is the proper way to use add_rewrite_rule to remove the (question mark)?
- Rewrite rule help for gallery plugin
- Plugin with custom domain
- Can’t get pretty permalinks to work without index.php
- How to get the real address from a url (permalink)
- Remove base from the custom post type URL [duplicate]
- My WP site and password was hacked, what to do? [closed]
- How can I output completely custom content with plugin while still having header, footer, sidebar etc [closed]
- URL Redirect on GoDaddy platform [closed]
- Allow direct access to files/folders within WordPress to replace wp-admin
- Rewrite Page Parameters
- Rewrite Rule in htaccess convert query string into slashes
- WP-Include rewrite directory
- Redirect OLD/Path to NEWURL/Path
- wp-login 404 page not redirecting to homepage [closed]
- Trying to Find the PHP File/Function that Handles a Specific Form Action URL
- Unable to register rewrite rule using add_rewrite_rule
- How to use Rewrite Tag Parameters in URL-rewritten Page’s Titles (META & H1)?