Request ModifyRedirect / Rewrite• 4 min read
How to Rewrite and Redirect API URLs Without Code Changes
Summary: Reroute any outgoing API request or video stream from one URL to another seamlessly. Perfect for pointing production apps to local mock servers or staging CDNs.
Why This Rule Matters for Developers & QA
Changing API endpoints typically requires updating environment files, rebuilding apps, or distributing new binaries to test devices. With URL rewriting, you intercept requests at the network layer and swap the destination in real time.
Step-by-Step Implementation Guide
1
Specify the Request Pattern
Enter a wildcard pattern or exact URL matching the request you want to redirect (e.g. `https://api.production.com/v1/auth`).
2
Set Target Replacement URL
Enter your destination endpoint, such as your local development server (`http://localhost:3000/v1/auth`) or staging sandbox.
3
Activate and Test
Toggle the rule on. When your app or smart TV calls the original endpoint, ProxyCeptor rewrites the target destination before sending the request.
Configuration Snippet
How to Rewrite and Redirect API URLs Without Code Changes — proxyceptor-rule.json
JSON
{ "id": "rule_rewrite_auth", "name": "Redirect Auth to Localhost", "pattern": "https://api.production.com/v1/auth*", "action": "redirect", "targetUrl": "http://localhost:3000/v1/auth", "enabled": true}