简体   繁体   中英

next js production deploy 404 error on sub pages

i have deployed code on production for next js build, i have used this command

next export -o outDir

and uploaded my build code to production, i can see only home page is working, when i tried /login it gives me 404 error, can anyone please help me how to resolve this issue? here i have also attached code for my next.config.js

module.exports = {
    exportPathMap: async function (
      defaultPathMap,
      { dev, dir, outDir, distDir, buildId }
    ) {
      return {
        '/': { page: '/' },
        '/login': { page: '/login' },
        '/chat': { page: '/chat' },
      }
    },
  }

I think you should go to /login.html instead of /login .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM