Skip to content

Commit

Permalink
Set index.html as fallback page for dynamic routes
Browse files Browse the repository at this point in the history
  • Loading branch information
OLILHR committed Oct 30, 2024
1 parent c4a5515 commit 09c85b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions staticwebapp.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/*.png", "/*.jpg", "/*.gif", "/*.svg", "/*.css", "/*.js"]
},
"routes": [
{
"route": "/ebd/*",
"rewrite": "/index.html"
},
{
"route": "/*",
"rewrite": "/index.html"
}
],
"responseOverrides": {
"404": {
"rewrite": "/404.html",
"statusCode": 404
"rewrite": "/index.html"
}
}
}
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const config = {
adapter: adapter({
pages: "build",
assets: "build",
fallback: "404.html",
fallback: "index.html",
paths: {
base: process.env.BASE_PATH || "",
},
Expand Down

0 comments on commit 09c85b5

Please sign in to comment.