404 error after adding `trailingSlash: false` in a docusaurus website - http-status-code-404

The bounty expires in 3 days. Answers to this question are eligible for a +100 reputation bounty.
SoftTimur wants to draw more attention to this question.
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?

Related

After Deploying the React app the page displayed is black on github pages

https://itsmenick.github.io/my-portfolio/ this is my url
I did all the changes regarding the deployment ie changes in script and all but still not reflected in this.
https://github.com/ItsMeNick/my-portfolio/ this is my github path to repository
Can anyone say what is the mistake ?
That is odd. and the development build works just fine? I noticed there is a cors error from you github page and this could be your issue.

If I refresh the browser my react app are being page not supported error message

I'm new in react app development, I just build my practice app and deployed it through Netlify. I can visit my app and everything is fine till I refresh my window. Refreshing the window comes with an error page not found. what should I do to solve this problem?
You may need to look at providing a _redirects file in your root directory. See https://docs.netlify.com/routing/redirects/
For example,
/* /index.html 200
As cra is single page application, you need server setting to redirect everytime to index.html,
You might want to check this link
https://www.netlify.com/blog/2020/04/07/creating-better-more-predictable-redirect-rules-for-spas/

404 error when reloading reactjs site deployed on github pages

I recently deployed a reactjs website on github pages using the custom domain -https://titanmarket.co.ke/.
The website works as expected but returns a 404 error when you reload a page. Usually, a user would expect the current page to be displayed on refresh.
Any insight on this would be great.
This may answer your question link Reference, Also see this
Super easy solution for Github pages reload 404 error.
in the src/public/ index.js file add this script below to the bottom body:
Index.js
https://github.com/rafgraph/spa-github-pages/blob/gh-pages/index.html
Create a 404.html file in the root directory:
404.html
https://github.com/rafgraph/spa-github-pages/blob/gh-pages/404.html
Read more:
Source:
https://github.com/rafgraph/spa-github-pages

React apps have stopped working on Github Pages - 404 Error

My React Apps were working perfectly on Github Pages until a few days ago, now they are all giving me 404 errors.
I'm not sure what to try, I haven't changed anything so I'm not sure why they're suddenly not working.
Here is a link to an example: https://github.com/paulmartin91/WikiSearch
It used to host a wikipedia search page, but now I'm getting the following...
"
404
File not found
The site configured at this address does not contain the requested file.
If this is your site, make sure that the filename case matches the URL.
For root URLs (like http://example.com/) you must provide an index.html file.
Read the full documentation for more information about using GitHub Pages.
GitHub Status — #githubstatus
"
It is working locally.
Thanks!
All fixed, I was using the github url 'https://github.com/paulmartin91/WikiSearch' as the package.json.homepage instead of the gh-pages url.

Polymer starter-kit navigation by url broken, but only when deployed

Navigation by url to my polymerCLI generated starter-kit works perfectly deployed locally by ">polymer serve", but navigation by url is broken when deployed to an https site.
Entire generated app untouched is on github at https://github.com/datafundamentals/polymer1-starter-debug
README describes exact details.
Entire built and deployed starter-kit untouched is at https://cliffdweller.work/view1 but emptying cache and hard reload may be necessary to display 404 if you nav by menu first.
Really hope that I just haven't skipped some docs somewhere but if so, I'm sure I'll get the flames I deserve. I've been scratching my head on how to even look it up?
The answer to this question was posted polymer error on reloading
There are two fixes required, both the use-hash-as-path property and the use of the #/ as a prefix, so a quick glance at this answer may not be sufficient.

Resources