Rewrite rules
Rewrite rules let you change requests and responses on the fly before they reach the server or the UI.
What rewrite rules can do
Use rewrite rules to:
- Redirect requests to a different URL.
- Modify request headers, query params, cookies, or body.
- Modify response headers, body, or status code.
- Block requests entirely.
- Map requests to local responses (mocking).
Create a rule
- Open Settings → Rewrite Rules.
- Tap Add Rule.
- Choose a Rule Type (redirect, modify, block, map).
- Configure the Match criteria (exact, contains, wildcard, or regex).
- Add one or more Actions.
- Save and enable the rule.
Matching and priority
- Rules match on the request URL.
- Use priority to control evaluation order.
- Enable Stop processing to prevent later rules from running after a match.
- Use tags to group and filter rules.
Common actions
- Set or remove headers.
- Replace or set the body.
- Redirect to a new URL.
- Add delays or throttling.
- Encode/decode body content.
- Adjust status codes and connection behavior.
Tip
Start with a single rule and verify it applies to one request before broadening the match pattern.