Skip to Content
Advanced FeaturesURL Redirects

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
FlagDefaultDescription
--nameautoRule name
--fromSource URL pattern (required)
--toDestination URL (required)
--matchexactMatch type: exact, wildcard, regex

List redirect rules

apxy rewrite list

Remove 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 wildcard

Local development

Redirect external API calls to a local server:

apxy rewrite set --from "api.example.com" --to "localhost:3000" --match wildcard
Last updated on