You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`previousMiddleware`| Function | Middleware to be executed before redirection.io middleware |
87
+
|`nextMiddleware`| Function | Middleware to be executed after redirection.io middleware |
88
+
|`matcherRegex`| String or null | Regex to specify which routes should be handled by redirection.io middleware |
89
+
|`mode`| "full" or "light" | If "light", redirection.io middleware will only redirect and not override the response (default: "full") |
90
+
|`logged`| Boolean | If true, redirection.io middleware will log information in Redirection.io (default: true) |
91
+
## Light mode
86
92
87
-
### Next.js
93
+
The response rewriting features (e.g., SEO overrides, custom body, etc.) of redirection.io are currently not compatible with React Server Components (RSC). This is due to the fact that Vercel’s middleware implementation does not follow standard middleware protocols, requiring us to fetch requests, which is incompatible with both RSC and Vercel’s implementation.
94
+
95
+
However, we provide a light mode that supports RSC by offering only the redirection functionality. To enable this mode, simply set the `mode` option to `light`.
96
+
97
+
This allows you to implement redirection behavior without modifying response content, ensuring smooth operation with RSC.
98
+
99
+
```typescript
100
+
const middleware =createRedirectionIoMiddleware({
101
+
// …
102
+
mode: "light",
103
+
});
104
+
```
105
+
106
+
## Next.js
88
107
89
108
If you are using next.js middlewares, you can use the `createRedirectionIoMiddleware` method
90
109
from `@redirection.io/vercel-middleware/next` which is compatible with `NextRequest` type.
0 commit comments