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
- Security and .htaccess
- How to add custom rewrite rule to .htaccess?
- How to stop wordpress from changing default .htaccess permissions to 444
- What does a security risk in a plugin look like?
- How Do I add a redirect rule to WordPress?
- What is the best way to output plugin result in certain url
- Using rewrite rule to access a view of a plugin from home page
- Dynamic URL, not a physical page within the database
- Leverage browser caching not working after updating .htaccess
- Woocommerce different URL for every table placed in the restaurant
- How to install WordPress Multisite with different domains under the same subdirectory?
- Error Message from W3 Total Cache when .htaccess Rules Cannot Be Modified? [closed]
- Custom rewrite rule
- How to add rewrite rules and pagination to retrieve attachments files?
- WordPress redirect all 404 pages to the Homepage
- How can I serve a text file at a custom URL
- Rewrite url without flushing the database?
- Custom page slug without creating a WP page
- WordPress URL redirect
- Checking that the Rewrite API is available
- Why slash is removed after domain?
- Url Rewriting a dynamic wordpress page
- .htaccess rewrite
- Plugin appends ugly URL string to index
- Headers Content-Security-Policy CSP Major Issue
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- Create a multisite network for an existing installation
- register_taxonomy and variable rewrite slug
- admin-ajax.php warning max input vars exceeded on layered pop plugins [closed]
- 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
- RSS feed rewrite matching wrong rule
- How to customize a title by passing query string?
- WordPress plugin url for form submit
- rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked
- Rewrite specific action url
- Username Variable in custom links?
- Passing value as hidden parameter to next page
- How do I make WordPress revise an .htaccess file a certain way?
- rewrite file to wordpress
- Dynamic URL Rewrite for Custom
- Change language on website and change currency with url query
- Add a parameter at the end of the url and prettify
- one url for all pages
- plugin: rewrite rules are lost when WP updates
- WordPress drop domain alias
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- How to add subdomain to htaccess
- How to regenerate slugs for categories and tag converting non-Latin characters?
- Rewrite in plugin
- add_external_rule – rules deleted when visiting permalinks page
- Site not displaying correctly when re-directing from root to sub-directory
- Disable default posts (Posts,Pages,Comments and Media) in wp-admin
- Custom shortcode with dynamic rewrite
- Rewrite URL to plugin file
- Change Admin URL
- How to remove post redirects
- Migration from old CMS to WordPress 301 redirection rules?
- How to create custom content on custom page from plugin?
- Can’t get pretty permalinks to work without index.php
- How to get the real address from a url (permalink)
- My WP site and password was hacked, what to do? [closed]
- URL Redirect on GoDaddy platform [closed]
- Rewrite Page Parameters
- Rewrite Rule in htaccess convert query string into slashes