Articles

Undo a bad redirect without redeploying your app

Inspect a wrong redirect, restore a saved Gregale edge rule set, and verify the same deployment keeps serving.

Updated

If a redirect lives at Gregale's edge, fix it at the edge. Updating that rule or restoring a saved rule set doesn't require rebuilding the site or rolling back the app. Restore a saved version only if you want all the rules in that version back. If other rules changed since, edit the one bad redirect instead.

Download the runnable drill. It makes one versioned redirect mistake on a disposable app, then checks the rule history, the public response, and the app deployment separately.

1. Find out what the edge is sending

Inspect the redirect response without following it. Use the exact hostname customers are visiting and a normal GET, rather than assuming a HEAD request matches the same rules.

sh
curl -sS -D - -o /dev/null https://example.com/docs

Check both the status and the Location header. Request the destination separately to confirm it serves the right page. A redirect can be a valid HTTP response and still send customers to a 404.

If a fresh request sees the right destination but a browser still goes to the old one, check cached redirects at the browser or any CDN in front. Restoring an edge rule does not erase a previously cached 301 or 308 from someone else's browser. The drill uses temporary 302 redirects and checks them from fresh curl requests.

2. Inspect the saved version before restoring it

sh
gregale edge rule history --app my-site
gregale --json edge rule history --app my-site --version 12
gregale --json edge rule list --app my-site

Compare the saved rules with the current rules. A version is a snapshot of the whole rule set, not a patch. Restoring version 12 can remove a rule created in version 13 and restore settings changed after version 12. Pay particular attention to unrelated authentication, rate-limit, and routing changes. If you only want to correct one redirect, update that rule instead.

If the entire saved set is what you want, run the rollback and read the current history again. The restore creates a new version; it does not erase the versions in between.

sh
gregale edge rule rollback --app my-site --to 12
gregale edge rule history --app my-site

Avoid doing a whole-set restore while another person is editing the same rules. See rule changes and rollback for the versioning and validation behavior.

3. Prove it was a rule rollback, not a redeploy

The drill starts with /docs → /guide, then changes it to /docs → /missing. It adds a second redirect on /other after the good snapshot. After restoring the snapshot, /docs must point to /guide again and /other must return its original app response, not another redirect. It also checks that the original deployment still serves 100% of traffic. That's what separates this fix from a code rollback.

Use the Gregale CLI, Bash, curl, jq and OpenSSL. Export a test workspace key as GREGALE_TOKEN, extract the starter and run bash run-demo.sh. It creates one disposable public app with synthetic responses and verifies deletion afterward. No existing domain or DNS record is touched. The drill is an end-to-end check on one hostname, not a measure of global propagation.

If you're setting a redirect for the first time, see add a 301 without redeploying.

Questions

How can I fix a wrong redirect without redeploying?

If the redirect is configured at the edge, edit that redirect rule. To undo several related changes together, inspect and restore a saved edge rule set.

Does edge rule rollback restore just one redirect?

No. It restores the whole saved rule set as a new version. Edit just the redirect if unrelated changes must stay in place.

Does restoring the redirect clear browser caches?

No. A browser or intermediary that cached a permanent redirect can still serve it. Inspect a fresh response and the actual destination independently.