Create an endpoint. In the callback function for the endpoint call your plugin functions internally, so the whole WordPress environment is available and you are still on the same domain, no matter where the plugin URL is.
Plus, make sure not to flush the rewrite rules on every page load, use the (de)activation hook for that.
Related Posts:
- How to Rewrite WordPress URL for a Plugin
- How to Rewrite WordPress URL for a Plugin
- Any way to make Apache’s internal redirect work?
- Mapping multiple URLs to same page
- Add rewrite rule for rewrite endpoint
- Rewrite url for existing page without flush_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 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
- Help writing custom function with rewrite endpoint that generates a page from dynamic content
- 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
- How to pass a more variable with page/subpage in Wordprees URL?
- Custom slug in url for CPT and taxonomy
- add_rewrite_rule not working
- Mapping multiple URLs to same page
- Virtual Page with Registration form
- redirect word-press page with page values
- URL rewrite parameter lost (add_rewrite_rule)
- A tool to analyze rewrite rules? [closed]
- remove “index.php” from permalinks
- How to add multiple custom URL variables?
- Add rewrite rule to permalink structure
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Custom Rewriting to Plugin with Parameters
- Plugin to Consume a Web Service
- How to: Rest endpoint returning empty object
- Why does wordpress still strip my query var?
- Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions
- Removing rules from .htaccess
- flexible rewrite ‘ramble’ URLs with WordPress
- Custom endpoint that returns an xml
- URLs of plugin resources?
- Rewrite Point Doesn’t Work on Custom Taxonomy
- Add_rewrite_rule doesn’t add custom url in plugin
- add_rewrite_rule not registering on Multisite
- Endpoint on Specific Page Slug
- How to have multiple rewrite endpoints in the same URL?
- add_rewrite_rule not working for language specific characters
- flush_rewrite_rules() not working on plugin activation
- URL rewriting must be activated manually for my plugin
- custom permalink/shortlink with base62 encoded post ID
- How to add custom variable in url without redirect?
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Help With Rewrite_Rules For a Custom Plug-In
- Rewrite custom post type URL parameters
- WordPress Custom URL
- Change pagination url format
- Problem with dinamic add_rewrite_rule()
- Remove custom post type slug from URL and add taxonomy Slug
- Create custom permalinks to show Custom Post Type’s relationship?
- Possible to get all posts with my shortcode?
- custom wordpress rewrite
- Can’t retrieve body params from PUT endpoint using formdata
- Do I need to create an endpoint?
- REST Endpoint API 404
- How to list all images used on a specific page?
- Forward an old url rewrite scheme to a new one?
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Access to the template file of a plug-in
- Rewrite not working since upgrade to 5.9
- Check current URL is 404 in pre_option_stylesheet filter hook
- Multiple Taxonomy Items for Separate URLs
- 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
- Dynamic URL with rewrite rule not working
- Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin
- Creating a return url for getting data from external api
- How do I rewrite URL that has custom parameter
- Return raw image proxy for wordpress plugin
- How to force download a plugin generated file?
- a way to support totally different url structure
- Multiple Permalink Patterns for one page
- Plugins and how to assign urls to content
- Change url to posts if they have custom tax only
- Custom pages with plugin
- Pagination appearing twice in URL after rewrite
- How can I map a specific URL pattern to a plugin for processing
- Issue on Getting Images URL of the Post Gallery
- How can I send an id over the url?
- URL Rewrite for CPT single posts
- Apache rewrite rules and wordpress problem
- Use custom clean URLs for a plug in
- WordPress post-type create url rewriting
- How to use permalink query to go to specific tabs in posts
- WP Job Manger change jobs url (NOT slug)
- WordPress custom link with my plugin
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Personalized URL for non-logged in WordPress
- esc_url, esc_url_raw or sanitize_url?
- Custom rewrite, url path with parameters to a page
- How do I add multiple custom menu Woo-commerce my account page?