React Router DOM not working correctly on Amplify Console AWS : <p>I have deployed react app on Amplify Console following their documentation. The site is deployed and running fine, I am able to navigate using links but when I try to land to any url directly I get redirected to my configured 404 page.</p>

<p>Below is the code I am using</p>

<pre><code>ReactDOM.render(
  &lt;Router&gt;
    &lt;Route path="/" component={App} /&gt;
  &lt;/Router&gt;,
  document.getElementById("root"),
);
</code></pre>

<p>And here is how my route looks like -</p>

<pre><code>&lt;Switch&gt;
    &lt;Route
      exact
      path="/"
      render={(): JSX.Element =&gt; &lt;Home auth={this.auth} /&gt;}
    /&gt;
    &lt;Route path="/features" render={(): JSX.Element =&gt; &lt;Features /&gt;} /&gt;
    &lt;Route
      path="/pagenotfound"
      render={(): JSX.Element =&gt; &lt;PageNotFound /&gt;}
    /&gt;
    &lt;Redirect from="/**" to="/pagenotfound" /&gt;
&lt;/Switch&gt;
</code></pre>

<p>Here is the link to the app - <a href="https://master.dkf0zemoh330o.amplifyapp.com/features" rel="noreferrer">https://master.dkf0zemoh330o.amplifyapp.com/features</a></p>
