Skip to content

fix(redirects): send tools.oxlo.ai traffic to www.oxcode.ai - #42

Merged
ms-shashank merged 1 commit into
devfrom
fix/redirect-oxlo-to-oxcode
Aug 26, 2026
Merged

fix(redirects): send tools.oxlo.ai traffic to www.oxcode.ai#42
ms-shashank merged 1 commit into
devfrom
fix/redirect-oxlo-to-oxcode

Conversation

@pavithra-hn

Copy link
Copy Markdown
Collaborator

Problem

tools.oxlo.ai still serves the Oxlo tools playground. All Oxlo traffic should land on www.oxcode.ai.

Solution

Catch-all 307 added alongside the existing rewrites() in app/next.config.ts. The rewrites block is unchanged.

/api/ is excluded on purpose. Next evaluates redirects() before rewrites(), so a blanket catch-all would swallow both the /api/tools/[toolId] route handler and the /api/tools-stream/:toolId proxy to the Python runner — every tool run would break, including the long-lived streaming path that proxy exists to protect.

No logged-in exemption here, unlike the portal PR. Nothing on Oxtools needs one — key rotation and billing live on the portal, which keeps its own.

Temporary 307, not permanent, so it can be reverted without anyone's browser having cached it.

Testing

Local dev server, asserting status code and Location header:

  • /, /tools, /tools/[id] — all 307 to https://www.oxcode.ai/
  • /api/tools/x — still 405, not redirected
  • /api/tools-stream/x — still 500 with ECONNREFUSED :9080, not redirected. That error is the point: the proxy is still firing and trying to reach the runner, which isn't running locally. A redirect here instead would mean the rewrite had been swallowed.

npm run build passes.

Note on lint: npm run lint fails on this branch, but it fails identically on dev. biome.json sets useIgnoreFile: false, so it lints .next/ — 59 source files plus 629 build files is where the huge diagnostic count comes from. next.config.ts was already non-conforming before this change too (repo uses spaces, biome is configured for tabs). Left it alone rather than reformatting the file and burying an 11-line change under a full-file diff. Happy to do that separately if you'd rather.

Catch-all 307 to the OxCode site. /api/ is excluded because redirects run
before rewrites, so catching it would disable the tool route handler and
the streaming proxy to the Python runner.
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oxtools Ready Ready Preview Aug 26, 2026 6:33pm

Request Review

@oxlo-ai oxlo-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OxBot Review

Clean, focused config change that adds temporary 307 redirects to www.oxcode.ai while correctly preserving /api/* routes for tool execution and streaming proxies. Well-documented and appropriately cautious with the non-permanent status code.

Notes

  • Excellent attention to routing order: documenting that redirects run before rewrites and explicitly excluding /api/ prevents breaking the tool runner and streaming proxy.
  • Using a 307 instead of 301 is the right call for a temporary migration, avoiding stale browser caches if the redirect needs to be rolled back.
  • The separate root path rule is a good defensive measure since empty path matching behavior can vary across Next.js versions.

✅ Verdict: LGTM | No inline issues found | 1 file(s) reviewed | ⏱️ 32s


Automated review by OxBot

@ms-shashank ms-shashank left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ms-shashank
ms-shashank merged commit eaa0503 into dev Aug 26, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants