I have a website made by docusaurus 2.0.0-beta.18
. I realize that, in production, when I click on items in the sidebar it first goes to https://example.com/docs/a-page
. If I reload the page, the url becomes https://example.com/docs/a-page/
. This problem does not exist in localhost.
I think a url should be consistent before and after reloading. And like StackOverflow, a good style is not having /
in the end.
I searched issues of Docusaurus and it seems that trailingSlash would be the solution. So I added trailingSlash: false
under module.exports
in docusaurus.config.js
.
Then, I deployed this change to my production server with docker and nignix. Loading most of the pages of the website returned a 404 error
, while static contents could be loaded. Reloading nginx or recreating docker containers did not help.
So does anyone know if trailingSlash: false
would solve this trailing slash problem? And is the 404 error due to trailingSlash
?