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
- Custom pages with plugin
- Symbolic Links on dev box with plugins and stylesheets
- How to call images from your plugins image folder?
- Dynamic Endpoints
- Making a plugin file accessible via url rewrite?
- How to add multiple custom URL variables?
- Add rewrite rule to permalink structure
- Custom frontend page for plugin without a ‘physical’ page?
- add_rewrite_rule, plugin activation and plugin deactivation
- 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?
- Having Problem On Getting WP Post Gallery Images URL
- Filter to change the content of 404 page
- 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?
- External Rewrite Rules
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Tricky URL rewrite with custom values in url
- Rewrite Point Doesn’t Work on Custom Taxonomy
- 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
- add_rewrite_rule not registering on Multisite
- Endpoint on Specific Page Slug
- Add a query string to ALL links on site
- How make a multi language routes, with rewrite rules or rewrite endpoints?
- Does WP Have a Function To Generate .htaccess RewriteCond?
- How to have multiple rewrite endpoints in the same URL?
- Custom rewrite rule serves content, but returns 404 error code
- add_rewrite_rule not working for language specific characters
- How to Modify Existing Rewrite Rules?
- 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
- Newbie question: no index.php? in my plain wordpress permalink
- Redirect traffic to plugin
- Custom url for a plugin page add_rewrite_rule WordPress
- How to Add a Rewrite Rule for Only One Page?
- How to add custom variable in url without redirect?
- Best way to hook a custom url?
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Append country to ‘pretty’ url but serve same page
- How to building pretty URLs to reflect category hierarchy?
- How to add a Rewrite Rule / Category Structure
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- Help With Rewrite_Rules For a Custom Plug-In
- Rewrite custom post type URL parameters
- Front custom edit post page for each post
- Help with Rewrite Rule for Custom Post Type with Query String
- Rewrite Question Mark in Post Template to Make it Pretty URL
- WordPress Custom URL
- Change pagination url format
- Problem with dinamic add_rewrite_rule()
- Remove custom post type slug from URL and add taxonomy Slug
- Enpoint Not Found in Rewrite Tag Permalink
- Create custom permalinks to show Custom Post Type’s relationship?
- Per Page Permalink Structure for Page Post Type
- Possible to get all posts with my shortcode?
- Redirect to another page using contact form 7? [closed]
- Rewrite /category/cars into /topics/cars
- custom wordpress rewrite
- Can I use %category% like Templates in my Plugin?
- Create page (not the post type) dynamically
- Can’t retrieve body params from PUT endpoint using formdata
- How to grab query string from wp-content/uploads/.*
- Getting back a permalink from custom url
- Do I need to create an endpoint?