Answer the question
In order to leave comments, you need to log in
Why does the hosting get a 404 error when refreshing the ReactRouter page?
Greetings)
There is an application on reacr\redux. uploaded to hosting.
If you follow the links , then everything is fine.
But if you refresh the page at the address for example "/portfolio" , then it gives an error (404. That's an error. The requested URL was not found on this server).
Although on the local server, pages are rendered when updated.
I would be very grateful for your help :)
return (
<Router>
<div className="App">
<BgCosmos />
<header>
{responsive === false ? (
<Nav props="" />
) : (
<Touch isOpenNav={isOpenNav.bind(this)} open={openNav} />
)}
</header>
{responsive && (
<Nav open={openNav} isOpenNav={isOpenNav.bind(this)} />
)}
<NavSocial />
<Route>
<div className="content">
<Switch>
<Route exact path="/" component={Baner} />
<Route path="/portfolio" component={Portfolio} />
<Route path="/about-us" component={AboutUs} />
<Route path="/contacts" component={Contacts} />
</Switch>
</div>
</Route>
<WriteNow />
<footer>
<NavSocial />
</footer>
</div>
</Router>
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question