0

I'm working with my site at https://mtgranks.herokuapp.com/.

If you use the navigation options that appear when you click Sets and select the Dominaria option, the site properly navigates to https://mtgranks.herokuapp.com/DOM and loads the expected data.

The problem I am running into is if I type https://mtgranks.herokuapp.com/DOM and try to directly navigate to it through the URL, the site will return a 404.

Below is my basic Router, please let me know if you'd like to see any other areas.

export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path: '',
            name: 'home',
            component: Home,
        },
        {
// TODO: Limit available URLs people can type in.
            path: '/:set',
            name: 'set',
            component: Set
        },
    ]
})
Bonteq
  • 777
  • 7
  • 24
  • 2
    I'm not familiar with Heroku, but you will likely need to configure the server to deal with redirecting to the main page so that the Vue Router itself will deal with rendering the right "page" instead of the server trying to load the resource. See the docs for Vue Router: [HTML5 History Mode](https://router.vuejs.org/guide/essentials/history-mode.html#html5-history-mode) – zero298 Apr 22 '19 at 20:01
  • In fact, this question may help a bit if you are also using webpack: [React Routing works in local machine but not Heroku](https://stackoverflow.com/a/42866874/691711). – zero298 Apr 22 '19 at 20:03

0 Answers0