1

I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want.

For instance, I am in localhost/aboutus and everything is fine because I arrived here pressing a link. But If I refresh the webpage i get HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    import React, { Component } from "react";
    import {BrowserRouter, Route, Switch, NavLink} from 'react-router-dom';

   import Home from "./Pages/Home ";
   import AboutUs from "./Pages/AboutUs";
    import ContactUs from "./Pages/ContactUs";
    import Example from "./Pages/Login/Example";
    class App extends Component {
      render() {
        return (

            <Switch>
              <Route exact path="/" exact component={Home} />
              <Route exact path="/Example"  component={Example} />
             <Route exact path="/AboutUs"  component={AboutUs} />
              <Route exact path="/ContactUs"  component={ContactUs} />

              />
            </Switch>
            <Footer />

        );
      }
    }


    export default App;
  • Possible duplicate of [How to use react router (createBrowserHistory) on Microsoft IIS to make routing working?](https://stackoverflow.com/questions/35533291/how-to-use-react-router-createbrowserhistory-on-microsoft-iis-to-make-routing) – HMR Sep 06 '19 at 08:40

0 Answers0