404 error react router

<Switch>
   <Route path="/" exact component={Home}/>
   <Route path="/about" component={About}/>
   <Route component={Page404} />
</Switch>

4
2
Vlk 110 points

                                    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 = () =&gt; (
  &lt;Router&gt;
    &lt;Switch&gt;
      &lt;Route exact path=&quot;/&quot; component={Hello} /&gt;
      &lt;Route component={NotFound} /&gt;
    &lt;/Switch&gt;
  &lt;/Router&gt;
);

render(&lt;App /&gt;, document.getElementById('root'));

4 (2 Votes)
0
4
1
Diane 100 points

                                    &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule . /index.html [L]
&lt;/IfModule&gt;

4 (1 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to add 404 page in react router dom react router redirect 404s set 404 status for url from react 404 page routing react creating 404 page in react router react-router-dom 404 route for api react router dom catch all 404 route how to show 404 page in react router dom react 404 not found 404 page in react-router-dom how i make page 404 in react js with router react 404 page not found example react 404 page not found 404 page not found react router redirect react router 404 404 not found on page refresh react router dom 404 Not Found error react router dom how to return 404 not found with react react-router 404 not found on refresh react router dom create page 404 react router dom page 404 how to create 404 page in react router how to through 404 error in react why am i getting a 404 error on my react page 404 route in react router point to 404 in react reactjs 404 page 404 page react router dom react no 404 404 page react 404 on react route express 404 error with react route react status 404 set 404 page react router dom react router dom 404 on refresh react js router dom 404 implement a 404 page in react react 404 page react 404 not found 404 not found react add 404 page react router react how to route to 404 not found page 404 error redirect react router how to have a 404 route in react 404 page in react react router 404 page\ 404 nav page react-router-domn react router 4040 route 404 react example react router Page not found (404) Request Method: GET 404 route react router react 404 router react-router shows 404 error react router 404 production 404 page not found error react router error 404 page react js handle 404 react router react router catch 404 getting 404 error react catch all react router handling 404 make route 404 react how to get all 404 pages in react 404 error react project react node 404 not found react router default route 404 react how to disply 404 react js router - 404 page paths show 404 react build react router throws cannot get 404 making a 404 component page work in react router oage not found react error page router react react how to catch a 404 error react router handle 404 handling 404 in react handling 404 page react router react router error /?#/path reactjs 404 page router PATCH modify 404 react route 404 react routing of 404 react react 4040 error route react route 404 page url not changed react route 404 page react router 404 route react router redirect 404 React 404 route react router dom path to 404 react async doesn't catch 404 errors display error after 404 react js react router dom how to render notfound page typescript react router dom catch all routes react-router-dom 404 page page not found in react router 404 page with react router react 4040 how to render 404 page when route not found in react react router 404 if not match react router config 404 implement 404 page in home page and outside page route example reactjs react 404 page route eact router 404 not found 404 error page in react react-router-dom error 404 react fallback route 404 react router using react route says 404 page not found react router dom react routing if not found if path ndont match redirect to 404 react Object-based routes with 404 page 404 page react router 6 put 404 not found react 404 page react router 404 route react router dom react router dom 404 page react router fallback route router 404 404 route react is showing all page 404 error in react js react redux 404 page 404 handle reactjs react 404 error page react router error page react how to route to error page react catch 404 error react router 404 page reactjs ./404 react router dom handle 404 404 route react 404 page in react router 404 error react router get 404 dom switch react router making a 404 route react router catch all routes react routing 404 react dom router catch all how to display a page if no routes match in react router dom react if 404 react router dom 404 react router 404 react router catch all react router catch all 404
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source