Hello,
I’ll dive right in:
My dist
folder is uploaded to and has to be served from: https://www.mywebsite.com/xx/xx/myproject/index.html
The second you go to that url, it changes to:
https://www.mywebsite.com
So now when you refresh the page, you get the homepage instead.
Then I learned about the base
property of the router and added 'xx/xx/myproject/'
to it.
The result: https://www.mywebsite.com/xx/xx/myproject/
Progress! But that would still lead to unknown page on refresh, as it needs the /index.html
at the end.
Then I thought, maybe I can just add it to the path itself. So this is the config I ended up with eventually
export default new Router({
base: '/xx/xx/myproject/',
mode: 'history',
routes: [
{
path: '/index.html',
name: 'timeline',
component: Timeline
},
{
path: '*',
redirect: '/index.html'
}
]
})
And to my surprise, this actually worked!
Though I’m very doubtful that this is the way to go, because while this is working in production, it does not in development (which is to be expected, really…). Having the same configuration locally and refreshing the page results in: Cannot GET /xx/xx/myproject/index.html
Would love to get an opinion of those who know better
Thank you!