Problem 1
Your hook ci_add_rules()
will still run when you flush rules, so remove it first (and avoid “unsetting” non_wp_rules
, you’ll break other plugins that make use of it).
function ci_remove_rules()
{
remove_action( 'generate_rewrite_rules', 'ci_add_rules' );
$GLOBALS['wp_rewrite']->flush_rules();
}
Problem 2
Pretty sure you want:
plugin_dir_url( 'proxy.php', __FILE__ )
..instead of:
plugin_dir_path( __FILE__ ) . 'proxy.php
Related Posts:
- Making a plugin file accessible via url rewrite?
- Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions
- Append country to ‘pretty’ url but serve same page
- htaccess – Redirect to subfolder without changing browser URL
- Generic htaccess redirect www to non-www
- A tool to analyze rewrite rules? [closed]
- Masking wp-content/themes/name/images to just images directory using htaccess
- Edit or Remove Plugin .htaccess Using The Admin Panel
- How to Rewrite WordPress URL for a Plugin
- Custom Rewriting to Plugin with Parameters
- How to map permalinks with accented letters to sanitized slugs?
- Filter to change the content of 404 page
- Mapping multiple URLs to same page
- Pages 404 in wordpress
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Rewrite url for existing page without flush_rewrite_rules
- Does WP Have a Function To Generate .htaccess RewriteCond?
- Custom rewrite rule serves content, but returns 404 error code
- URL rewriting must be activated manually for my plugin
- Error “Call to a member function switch_to_locale() on null” during insert_with_markers
- How to change the URL pattern for single post view
- Why doesn’t flush_rewrite_rules run on plugin activation?
- Rewrite rule to load images from production does nothing
- Redirect traffic to plugin
- Remove base slug in permalinks of hierarchical custom post type
- WordPress rewrite rules don’t need ^?
- Why is my mod_rewrite not working?
- Adding rewrite rules directly to .htaccess file
- Modifying the default WordPress .htaccess with a plugin
- a one-off rewrite rule
- How To Consistently Enforce Rewrite Rule in Plugin Development
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- Adding rewrite rule dynamically
- Change htaccess to redirect to index.php in subfolder
- How to remove wordpress directory slash
- rewrite URL based on selected taxonomy for post page
- How to restrict access to image folder depending on whether product is purchased or not?
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- Map secondary domain to other’s virtual subfolder
- 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?
- add_rewrite_rule behaving strangely
- mod-rewrite exception? keep #hash in matching urls?
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- Create page (not the post type) dynamically
- How can I add rewrite rules to a class-based plugin?
- force www rewrite if wordpress put in a folder
- configuration of .htaccess for add_rewrite_rule to make sense
- 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?
- How do I make WordPress revise an .htaccess file a certain way?
- Rewriting Image URLs from dynamic to original
- Custom Path for a Plugin
- .htaccess with WordPress – create my own pretty url with parameters (above WordPress settings)
- Custom post type change permalink query
- Change cannonical URL after changing url with add_rewrite_rule()
- Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin
- WordPress custom url without using any of the custom tags given
- Pretty URL via Rewrite
- URL Rewrite 404
- Using meta_key & meta_value in add_rewrite_rule
- How to force download a plugin generated file?
- How to pass a more variable with page/subpage in Wordprees URL?
- Any way to make Apache’s internal redirect work?
- ModRewrite not working properly
- Rewriting URLs with a query string
- How can I send an id over the url?
- Apache rewrite rules and wordpress problem
- Custom slug in url for CPT and taxonomy
- add_rewrite_rule not working
- Mapping multiple URLs to same page
- Use custom clean URLs for a plug in
- 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
- Can’t get pretty permalinks to work without index.php
- How to redirect a virtual page (e.g. /blog) to the home page?
- redirect word-press page with page values
- Add rewrite endpoint and .htaccess
- URL rewrite parameter lost (add_rewrite_rule)
- Custom rewrite, url path with parameters to a page
- How to provide translations for a WordPress TinyMCE plugin?
- Where do I start from
- Add tab to profile.php wordpress plugin development
- WP and object persistence (or lack thereof)
- Bad Request in AJAX
- Rewrite rule and display of post
- How to remove/replace current page template?
- Generating a password-protected front-end page via a plugin
- wp_remote_post not working with admin-post.php
- Default media uploader is not showing in wordpress website
- Load custom translation in custom plugin fails
- Uncaught ReferenceError: kpoejy is not defined
- Is there better way to do this without duplicating queries?
- Additional .htaccess rules based on wp page
- How can i add insertion point between inner blocks in my custom block like core blocks
- Allow HTML in product attributes and variation for WooCommerce