When I generate Nuxtjs in SPA mode (SSR: false), there is no index.html file in the dist folder generated by nuxt.
So I have two questions
1st: I need to redirect to lang folder, for example exmple.com redirect to exmaple.com/{locale}
2nd: I need to redirect for subpages, for example exmple.com/admin to exmaple.com/{locale}/admin
// nuxt.config.js ... i18n: { lazy: true, langDir: 'lang/', locales: [ { code: 'en', iso: 'en-US', file: 'en.js', name: 'English' }, { code: 'ar', iso: 'ar-EG', file: 'ar.js', name: 'عربى' } ], defaultLocale: { locale: 'en', prefix: true }, ...
I have an idea to solve this problem, but I don't know if it is the best solution.
Just use
.htaccess
to handle the request and return the desired index.