1

Locally I have the following routes in my react app. And those are working:

const routes: Route[] = [
  {
    path: '/login',
    title: 'Login',
    scope: 'auth',
    component: Login,
  },
  {
    path: '/login-admin',
    title: 'Login Admin',
    scope: 'auth',
    component: LoginAdmin,
  }, 

I can navigate both: localhost:3360/login and localhost:3360/login_admin

However, when I upload files on server (shared hosting, so I upload build folder content manually) and there is no command line support, then those routes are not working.

I can open www.mypage.com and it redirects me to www.mypage.com/login (it is desired functionality), however, if I enter directly www.mypage.com/login or www.mypage.com/login_admin then it says "Not Found".

Sidenote: this app was not developed by me. It was done by another developer and given to me. It works locally, but not on production server.

renathy
  • 5,125
  • 20
  • 85
  • 149
  • Check [this related answer](https://stackoverflow.com/a/62050700/2873538). You need to your server to redirect to "index.html" for 404 errors. – Ajeet Shah Mar 18 '21 at 22:47
  • If you are using hostgator or something similar [this](https://medium.com/dev-genius/deploying-your-react-app-to-hostgator-quick-and-painless-9807cf939532) helped me, specifically the part about the .htaccess file – WebbH Mar 19 '21 at 03:13

0 Answers0