0

I have a react app created with the create-react-app template and want it be deployed on IIS as a part of another application folder.

On client navigation after loading the navigated component is loaded but when i refresh the url from the browser i get a 404 error

For example: i build using npm run build with package.json

package.json

I have also set the base name to the Router component

BrowserRouter

on open of the react site and navigation to the component "Admin" it shows the component properly. But when i reload the same url by refreshing from the browser refresh button i get an 404 error page not found.

When i run using the npm start it runs with http://localhost:3000/ as default and on component navigation changes the url to http://localhost:3000/admin . here if i refresh from the browser it loads the page and navigates properly showing the navigated component.

What am i missing to make this work ?

enter image description here

user581157
  • 1,327
  • 4
  • 26
  • 64
  • How are you able to solve this? – Temi 'Topsy' Bello Jun 19 '19 at 11:13
  • The react app was placed in a folder and the web.config where the url rewrite was not a part of it hence added the web.config at the folder level where the react app was place along with routes. – user581157 Jun 19 '19 at 11:21
  • I am facing this kind of issue too and I dont know the workaround yet. Here is the link https://stackoverflow.com/questions/56651771/react-production-build-shows-404-on-page-refresh – Temi 'Topsy' Bello Jun 19 '19 at 12:31

0 Answers0