<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oluwatobi Ishola on Medium]]></title>
        <description><![CDATA[Stories by Oluwatobi Ishola on Medium]]></description>
        <link>https://medium.com/@ishoshot?source=rss-b835e6ef0824------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PbDfaT23uZQHiL3B.jpg</url>
            <title>Stories by Oluwatobi Ishola on Medium</title>
            <link>https://medium.com/@ishoshot?source=rss-b835e6ef0824------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:28:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ishoshot/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Page Not Found on Reload Vuejs — Netlify]]></title>
            <link>https://medium.com/@ishoshot/page-not-found-on-reload-vuejs-netlify-c71716e97e6?source=rss-b835e6ef0824------2</link>
            <guid isPermaLink="false">https://medium.com/p/c71716e97e6</guid>
            <category><![CDATA[vue-router]]></category>
            <category><![CDATA[netlify]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Oluwatobi Ishola]]></dc:creator>
            <pubDate>Thu, 07 Nov 2019 13:47:27 GMT</pubDate>
            <atom:updated>2019-11-07T13:47:27.899Z</atom:updated>
            <content:encoded><![CDATA[<h3>Page Not Found on Reload Vuejs — Netlify</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Eubn8pCmb2UkUMRs.jpeg" /></figure><p>Have you hosted your app (Single Page Application) on Netlify and gotten a heart break when you reload any page/component and saw “Page Not Found” ?</p><p>Don’t worry, The solution is almost no brainer as it is just 1 simple task.</p><h3>QUICK PEEK ON THE PROBLEM.</h3><p>Vue Router has a property that you set on; it’s called <strong>mode</strong>. It can have different values and each values have their uniqueness.</p><p>Here’s what the Vue-Router documentation says:</p><blockquote><em>The default mode for </em><em>vue-router is hash mode - it uses the URL hash to simulate a full URL so that the page won&#39;t be reloaded when the URL changes.</em></blockquote><blockquote><em>To get rid of the hash, we can use the router’s history mode, which leverages the </em><em>history.pushState API to achieve URL navigation without a page reload:</em></blockquote><p>In <strong>hash mode</strong> our url would look like this localhost:8080/#/endpoint</p><p>In <strong>history mode</strong> our url would look like this: localhost:8080/endpoint</p><p>Guess you have seen this, but don’t until now. Don’t worry, there’s more to learn.</p><p>When hosting on any server like Netlify, if you refresh the page on any url other than ‘/’ you will receive a 404 error. This will also happen if a user tries to directly access a url on your site. This is quite not ideal, and really limits how users interact and can share your website.</p><p>Vue Router documentation has information on how you can fix this; But unfortunately, not quite with Netlify. To check the documentation, see <a href="https://router.vuejs.org/guide/essentials/history-mode.html#html5-history-mode">here</a>.</p><h3>SOLUTION</h3><p>All you have to do is to create a file called <em>_redirects </em>in the /public folder in your application and please note that this file should not have an extension. Ever wondered what will be in this file, just add this line of code:</p><p>/* /index.html 200.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jIP4CS6F2vcXuN6j.png" /><figcaption>My Project Snapshot</figcaption></figure><p>Read more because Netlify has documentation on redirects <a href="https://www.netlify.com/docs/redirects/">here.</a></p><p>And guess what, That’s All!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/191/1*cc2Tem-Mj7lgPebH0hgOIQ.jpeg" /></figure><p>But there is one little problem, the initial problem is solved but there is a new behaviour of the application to be corrected. If a user enters a wrong url, it will automatically redirect to the index.html page and which i am sure you don’t want that.</p><p>Sue you know how to do that. But incase you don’t.</p><h3><strong>A SNEAK PEEK INTO SOLVING THE NEW PROBLEM</strong></h3><p>Just create a custom 404 page, setup a new route like this:</p><p>{<br> path: ‘/*’,<br> component: 404<br>},</p><p>in the routes.js or route/index.js depending on whichever you find yourself using. And this will allow you application to redirect to a proper 404 page whenever a user enters a wrong url.</p><p>The you can successfully test your application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c71716e97e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>