Skip to content

Commit

Permalink
Set fallback to 404.html instead of rewriting the index.html file
Browse files Browse the repository at this point in the history
  • Loading branch information
OLILHR committed Oct 29, 2024
1 parent c269bcc commit b89ce14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion staticwebapp.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"navigationFallback": {
"rewrite": "/index.html",
"rewrite": "/404.html",
"exclude": [
"/images/*.{png,jpg,gif,ico}",
"/*.{css,scss,js,png,jpg,gif,ico,svg}"
Expand All @@ -11,10 +11,21 @@
"route": "/ebd/*",
"serve": "/index.html",
"statusCode": 200
},
{
"route": "/*",
"serve": "/404.html",
"statusCode": 404
}
],
"mimeTypes": {
".json": "text/json",
".svg": "image/svg+xml"
},
"responseOverrides": {
"404": {
"rewrite": "/404.html",
"statusCode": 404
}
}
}
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: "index.html",
fallback: "404.html",
paths: {
base: process.env.BASE_PATH || "",
},
Expand Down

0 comments on commit b89ce14

Please sign in to comment.