URL Redirects
Redirect requests from one URL to another without changing your application code. The client never knows the request was rerouted — APXY transparently forwards it to the new destination.
Web UI
Open Redirects from the Modify group. The page provides:
- A form to create redirect rules with From URL, To URL, and Match Type (exact / wildcard / regex) fields
- A list of all active redirect rules with enable/disable toggles
- Delete buttons for each rule
All changes take effect immediately — no proxy restart required.
CLI
Add a redirect rule
apxy rewrite set \
--from "api.production.com" \
--to "api.staging.com" \
--match wildcard| Flag | Default | Description |
|---|---|---|
--name | auto | Rule name |
--from | — | Source URL pattern (required) |
--to | — | Destination URL (required) |
--match | exact | Match type: exact, wildcard, regex |
List redirect rules
apxy rewrite listRemove a redirect rule
apxy rewrite remove --id <rule-id>Use Cases
Redirect production to staging
Test your app against staging without changing any client code:
apxy rewrite set --from "api.production.com" --to "api.staging.com" --match wildcard
# Test the app...
apxy rewrite remove --id <rule-id>API version migration
Route old API paths to the new version:
apxy rewrite set --from "api.example.com/v1/*" --to "api.example.com/v2/*" --match wildcardLocal development
Redirect external API calls to a local server:
apxy rewrite set --from "api.example.com" --to "localhost:3000" --match wildcardLast updated on