when I build my nextJs application on the server
after multi-refreshing the home page or other pages giving a 404 error
by the way I add this code to package json file but still have error
module.exports = {
trailingSlash: true
}
my page is SSG
my assets version
next: 13.1.6
react: 18.2.0
2
Answers
After many searches, we found that the problem is from the server side
We changed the webserver to Nginx and our problem was solved. I think there is a problem with Apache, but I don't know the details of the problem.
It’s an issue coming from next export and deploying static files, you can use Vercel instead of deploying static files.
for this issue create
.htaccess
file in your public folder and copy/paste this code in it: