Skip to content

Commit

Permalink
Avoid /my-prefix from being redirected to /my-prefix/
Browse files Browse the repository at this point in the history
Avoid https://my.domain/my-prefix from being redirected to
https://my.domain/my-prefix/ (with slash at the end) after SSR.

See the documentation for the redirect option:

https://expressjs.com/en/resources/middleware/serve-static.html
  • Loading branch information
wesleybl committed Jul 12, 2023
1 parent d6f8bab commit 7f435b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ if (process.env.RAZZLE_PREFIX_PATH) {
process.env.BUILD_DIR
? path.join(process.env.BUILD_DIR, 'public')
: process.env.RAZZLE_PUBLIC_DIR,
{
redirect: false, // Avoid /my-prefix from being redirected to /my-prefix/
},
),
);
}
Expand Down

0 comments on commit 7f435b0

Please sign in to comment.