fix(redirects): send tools.oxlo.ai traffic to www.oxcode.ai - #42
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()inapp/next.config.ts. The rewrites block is unchanged./api/is excluded on purpose. Next evaluatesredirects()beforerewrites(), so a blanket catch-all would swallow both the/api/tools/[toolId]route handler and the/api/tools-stream/:toolIdproxy 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
Locationheader:/,/tools,/tools/[id]— all 307 to https://www.oxcode.ai//api/tools/x— still 405, not redirected/api/tools-stream/x— still 500 withECONNREFUSED :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 buildpasses.Note on lint:
npm run lintfails on this branch, but it fails identically ondev.biome.jsonsetsuseIgnoreFile: false, so it lints.next/— 59 source files plus 629 build files is where the huge diagnostic count comes from.next.config.tswas 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.