title: Issue with react router dom 6.2.2
body: <p>i have some problem with url. When i write url or when i refresh then i get 404. For example when i write: .../oferta then i get 404. NavLinks works fine. I don't know what i do wrong :)</p>
  <p>error displayed is:404
  Not Found
  The resource requested could not be found on this server!</p>
  <p>&quot;react-router-dom&quot;: &quot;6.2.2&quot;,
  &quot;react-dom&quot;: &quot;^17.0.2&quot;,</p>
  <pre><code>import Footer from &quot;./Footer&quot;;
  import Home from &quot;./Home&quot;;
  import Oferta from &quot;./Oferta&quot;;
  import Realizacje from &quot;./Realizacje&quot;;
  import Kontakt from &quot;./Kontakt&quot;;
  import ErrorPage from &quot;./ErrorPage&quot;;
  import { BrowserRouter as Router, Route, Routes } from &quot;react-router-dom&quot;;
  import ScrollToTop from &quot;./ScrollToTop&quot;;
  import ScrollButton from &quot;./ScrollButton&quot;;
  import CookieConsent from &quot;react-cookie-consent&quot;;
  
  export default function App() {
    return (
      &lt;Router basename={process.env.PUBLIC_URL}&gt;
        &lt;Header /&gt;
        &lt;section&gt;
          &lt;ScrollToTop&gt;
            &lt;Routes&gt;
              &lt;Route exact path=&quot;/&quot; element={&lt;Home /&gt;} /&gt;
              &lt;Route path=&quot;/oferta&quot; element={&lt;Oferta /&gt;} /&gt;
              &lt;Route path=&quot;/realizacje&quot; element={&lt;Realizacje /&gt;} /&gt;
              &lt;Route path=&quot;/kontakt&quot; element={&lt;Kontakt /&gt;} /&gt;
              &lt;Route path=&quot;*&quot; element={&lt;ErrorPage /&gt;} /&gt;
            &lt;/Routes&gt;
          &lt;/ScrollToTop&gt;
          &lt;ScrollButton /&gt;
        &lt;/section&gt;
        &lt;Footer /&gt;
        &lt;CookieConsent
          location=&quot;bottom&quot;
          buttonText=&quot;Zgoda&quot;
          cookieName=&quot;myAwesomeCookieName2&quot;
          style={{ background: &quot;#2B373B&quot;, textShadow: &quot;2px 2px black&quot; }}
          buttonClasses=&quot;cat__link&quot;
          buttonStyle={{
            color: &quot;#4e503b&quot;,
            fontSize: &quot;14px&quot;,
          }}
          expires={150}
        &gt;
          Ta strona korzysta z plików cookies (ciasteczek) w celu poprawy odczuć
          użytkowników.
        &lt;/CookieConsent&gt;
      &lt;/Router&gt;
    );
  }```
  </code></pre>