Vue Router hosting on apache2 : <p>I am hosting my vuejs project on apache server.</p>

<ol>
<li>init project</li>
<li>setup router</li>
<li>Build and hosted to apache server </li>
</ol>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const router = new VueRouter({
  routes: Routes,
  // relative: true,
  mode: 'history'
});</code></pre>
</div>
</div>
</p>

<p>This runs fine in local, but vue router breaks on server.
Example</p>

<p>If I run <a href="http://example.com" rel="noreferrer">http://example.com</a> and go to <a href="http://exmaple.com/sub" rel="noreferrer">http://exmaple.com/sub</a>
It works fine</p>

<p>but if I refresh the page It will throw 404 Error.</p>

<p>Error:
<a href="https://i.stack.imgur.com/YCH98.png" rel="noreferrer"><img src="https://i.stack.imgur.com/YCH98.png" alt="enter image description here"></a></p>
