How does Next.js redirects to 404.html under the hood in static exports?
I have a website (let’s call it example.com
) built with Next.js, statically exported. When I type in a wrong address in the browser (i.e. https://example.com/wrong-addr
), it redirects to /404.html
, a default fallback file provided by Next.js. Here is what I think happening: