Home > Blockchain >  Issue with htaccess when deploying next js app to FTP (filezilla)
Issue with htaccess when deploying next js app to FTP (filezilla)

Time:09-17

EDIT:
Host had subdomain, so I have added basePath: "/thesubdomain", and now it works properly.

I tried to upload the out directory from next js app to filezilla that comes out after next build && next export. However now styles does not load and the nextjs basic router does not work too.

Basically raw html loads to browser.

How my .htaccess looks like (maybe that is the issue, dunno):

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [QSA,L

I didn't find anything in docs/google.

Thanks in advance!

CodePudding user response:

If host has subdomain (as in my case), try adding a basePath: "/thesubdomain" to your next.config.js. That should solve the problem.

CodePudding user response:

I'll suggest you run next build && next export on your local and then deploy the .next or build folder to FTP

  • Related