I followed these steps to deploy my nextjs on cPanel.
go to package.json and add this line: "homepage": "http://afsanefadaei.ir"
run next build to have .next folder as my build folder
go to cpanel >> file manager >> public_html folder and upload the contetn of .next folder to this directory
add or edit this file: .htaccess to:

but when I go to the website I face this:

Do you know what is wrong with this?
I uploaded out (which gets generated doing npm run build && npm run export) folder to public_html and created .htaccess file like
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-L
RewriteRule . /index.html [L]
</IfModule>
Problem: When I refresh the page on some different route let's say
/about, it brings theindex.jspage contents but URL doesn't change to/
.next doesn't have index.html file.next export instead of next build if 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With