3

I made a website using Nuxt, Tailwind and i18n. It's perfectly running locally (with nuxt build and nuxt start), but when I deploy it (with the same commands) on the server of a hosting company, every page except the "root" one is showing an error (this page could not be found) during half a second; before being replaced by the content of the page. But when I look at the HTML page, the content is the one of an error page. (contains "This page could not be found"); while it's not the case locally. Here is en example : https://jimmy.cf/contact Do you have any idea of where my problem could come from ? Thanks a lot !

pragmethik
  • 182
  • 1
  • 7
  • 1
    "every page except the root one". Sounds like server-side routing setup issue. Is this static generated website? or full client side rendering? how does the nuxt.config look like? `target: 'static'` and `ssr: false` ? – Kunukn Jan 01 '22 at 16:36
  • Thanks @Kunukn . It's an SSR website; nothing like target: 'static' or ssr: false in my config. I don't know if it can be the problem, but I'm executing nuxt build locally (because I don't have enough memory on the server) and nuxt start on the server of a hosting company. – pragmethik Jan 01 '22 at 18:53
  • it seems there might be some deployment setup that is missing. Have you seen these guides? https://nuxtjs.org/deployments/ Server-side-rendering requires some setup if I recall correctly. – Kunukn Jan 02 '22 at 19:48
  • 1
    I read it, thanks ; but my hosting company isn't in this list : it's a company where I have cPanel access + ssh access. Behind it's a Phusion Passenger (that listen to 3000 port), for Apache. I tried to put htaccess file (as described here : https://dev.to/dzulqurnain/deploying-nuxt-ssr-to-cpanel-j7g) ; and I also tried to configure cPanel with an entry point (https://stackoverflow.com/questions/66268891/how-to-change-entrypoint-on-nuxt-build), with the same result. – pragmethik Jan 03 '22 at 08:45
  • I think my .htaccess wasn't in the right place, seems to work now. Thanks again @Kunukn ! – pragmethik Jan 03 '22 at 10:24
  • Had the same issue caused by different .htaccess config. Link you shared saved me :) Thank you very much! – timewastingprofessional Jul 05 '22 at 23:39

0 Answers0