问题
I followed these steps to deploy my nextjs on cPanel.
go to package.json and add this line:
"homepage": "http://afsanefadaei.ir"run
next buildto have.nextfolder as my build foldergo to
cpanel >> file manager >> public_htmlfolder and upload the contetn of.nextfolder to this directoryadd or edit this file:
.htaccessto:
but when I go to the website I face this:
Do you know what is wrong with this?
回答1:
- Your
.nextdoesn't have index.html file. - Seems like you have server side (mostly using nodejs), but unfortunately you couldn't run that server side from cpanel.
- As I know, you should use
next exportinstead ofnext buildif you tend to have frontend side only.
But the most important thing is number 1, make sure you have index.html inside your .next folder.
来源:https://stackoverflow.com/questions/60008008/how-to-deploy-a-nextjs-application-on-cpanel