0

Given a vue.config.js file with this setup

pages: {
    index: {
        entry: 'src/main.js',
        template: 'public/index.html',
        filename: 'index.html'
    },
    otherpage: {
        entry: 'src/other.js',
        template: 'public/otherpage.html',
        filename: 'otherpage.html'
    }
}

I know I can navigate to the otherpage.html template with this url: domain/otherpage.html, but how can I access it with a url like domain/other?

Any help is appreciated, thanks!

TheCat
  • 640
  • 1
  • 9
  • 23
  • 1
    https://stackoverflow.com/questions/50857442/vue-cli-3-0-multi-page-setup-with-html5-history-mode – Matt U Aug 20 '21 at 21:42
  • 1
    There's a good starting point. But I think when you're on a production server you'll need to use URL rewrites on that server instead. – Matt U Aug 20 '21 at 21:43
  • This works indeed with the devserver, thanks! But Im stuck with htaccess rewrite for production.. I'm currently using the standard config from the doc (https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations). How can I add a rule to otherpage.html? – TheCat Aug 21 '21 at 14:59
  • Unfortunately I'm not sure, that's why I posted a comment rather than an answer. Have you searched SO for achieving the same thing on a non-dev server? – Matt U Aug 21 '21 at 15:06

0 Answers0