react router catch all 404
<Switch>
<Route path="/" exact component={Home}/>
<Route path="/about" component={About}/>
<Route component={Page404} />
</Switch>
react router catch all 404
<Switch>
<Route path="/" exact component={Home}/>
<Route path="/about" component={About}/>
<Route component={Page404} />
</Switch>
404 error react router
import React from 'react';
import { render } from 'react-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Hello from './Hello';
import NotFound from './NotFound';
const App = () => (
<Router>
<Switch>
<Route exact path="/" component={Hello} />
<Route component={NotFound} />
</Switch>
</Router>
);
render(<App />, document.getElementById('root'));
react router 404
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
</IfModule>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us