0

if url is typed http://anyhost.com/home, it is working fine,but if typed http://anyhost.com/home/unknown/unknown, it gives me blank page and, in dev tools it is showing me that index.html file in public folder is not able to find app.js,please find the below screenshot for error.

enter image description here

I dont know this is an react router problem or need to do setting in server config,please help me

using react router "react-router": "^4.2.0","react-router-dom": "^4.2.2",

tapan dave
  • 293
  • 2
  • 8
  • 18
  • Do you have an otherwise route aka not found aka 404? https://stackoverflow.com/questions/32128978/react-router-no-not-found-route – Sten Muchow Mar 13 '18 at 08:19
  • What are you using in server side express/koa ??. can you also paste your server side code where you server this html. – Vikramaditya Mar 13 '18 at 08:34
  • @vikramaditya,@sten-muchow i am using nginx, please check this gist https://gist.github.com/tapandave08/6636fd26e1c5a25bd0e6667805c6dbee – tapan dave Mar 13 '18 at 12:25
  • in your html file change this line from `` to ``. make sure assets folder is located in the same level from where you are running nginx server. – Vikramaditya Mar 13 '18 at 14:21
  • Also make sure you are sending the same html file from nginx server on all http requests. your nginx.conf file should be something like this.. `server { root /path/to/app-folder/; location / { try_files $uri $uri/ /public.html; } } ` – Vikramaditya Mar 13 '18 at 14:36
  • @vikramaditya thanks '/assets/app.js, ' i was searching for this thing from many days it worked – tapan dave Mar 14 '18 at 12:25

0 Answers0