Asked By: Anonymous
I got a problem to get my nextjs app running on my production server.
I portforward it via htaccess by following code:
RewriteRule ^(.*) <a href="http://127.0.0.1:1338/" rel="nofollow noreferrer">http://127.0.0.1:1338/</a>$1
Every route is working perfectly: /blog,/blog/:id, /about etc.
Just “/” is not working when rendered from serverside. I can navigate to it after loading another route without any problem.
I can also call it by /index but not with mydomain.tld
Does anyone have an idea?
Answered By: Anonymous
The issue happens when Apache tries to pass an index.html file to the next router which returns an error.
DirectoryIndex disabled to .htaccess file solves the problem.