Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

About redirect caveats #1741

Answered by dphang
Alecell asked this question in Q&A
Discussion options

I don't know if I get this:

Redirects. Caveat: every route should be able to redirect except _next/static/* and static/*, since those cache behaviors do not have Lambda handlers attached to them. Note that object format is not yet supported.

Does this mean that I can't redirect from a static page to any other or it means that I can't redirect from anywhere to a static page?

I also don't get the "object format support", what is the alternative? Is the domainRedirects from serverless config? I mean, on the nextjs docs the only format to make redirects is object as far as I can get.

I'm having issue when trying to redirect from a non-existent route to a static path, this is expected? 🤔

You must be logged in to vote

Yes, the new format actually refers to https://nextjs.org/docs/api-reference/next.config.js/redirects#header-cookie-and-query-matching. Let me update it to be clearer. It's not yet implemented since I hadn't a chance yet.

You cannot redirect from paths in _next/static/* and static/* as these are the static files path (like images or _next JS files) and don't have the Lambda handlers attached to it. Maybe with CloudFront functions, it should be possible (but not yet implemented)

Replies: 1 comment

Comment options

Yes, the new format actually refers to https://nextjs.org/docs/api-reference/next.config.js/redirects#header-cookie-and-query-matching. Let me update it to be clearer. It's not yet implemented since I hadn't a chance yet.

You cannot redirect from paths in _next/static/* and static/* as these are the static files path (like images or _next JS files) and don't have the Lambda handlers attached to it. Maybe with CloudFront functions, it should be possible (but not yet implemented)

You must be logged in to vote
0 replies
Answer selected by Alecell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /