We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 52c8edd commit 0af6afbCopy full SHA for 0af6afb
.changeset/dirty-dolls-heal.md
@@ -0,0 +1,18 @@
1
+---
2
+'@builder.io/qwik-city': minor
3
4
+
5
+FEAT: Support rewrite feature. should work like redirect, but without modifying the address bar url
6
7
+Example usage:
8
+```
9
+export const onRequest: RequestHandler = async ({ url, rewrite }) => {
10
+ if (url.pathname.includes("/articles/the-best-article-in-the-world")) {
11
+ const artistId = db.getArticleByName("the-best-article-in-the-world");
12
13
+ // Url will remain /articles/the-best-article-in-the-world, but under the hood,
14
+ // will render /articles/${artistId}
15
+ throw rewrite(`/articles/${artistId}`);
16
+ }
17
+};
18
0 commit comments