Closed
Description
Currently the middleware assumes that /
is the root of the app and works on top of that.
We could adapt it as follows:
- Don't hardcode the root URL
- All the places where an absolute URL is constructed, the
basePath
needs to be considered
- Somehow the
basePath
needs to be passed to the middleware. Maybe we could use the plugin that is worked on in feat!: Next.js 13 RSC integration #149 to read it from the Next.js config and then make it automatically available to the middleware (e.g. withwebpack.DefinePlugin
).
Potentially this could also help to implement region-specific routing, see #243 (comment) and #549
(discussed in #242)