egoist / vuepack

:package: A modern starter which uses Vue 2, Vuex, Vue-router and Webpack 2 (and even Electron)
http://vuepack.surge.sh
MIT License
2.43k stars 202 forks source link

Vue-router: History Mode - Built app blank on public subdirectory #161

Open MarioCarloni opened 6 years ago

MarioCarloni commented 6 years ago

We've developed an app using Vuepack, and wish to use vue-router's history mode to remove the hash sign from the web address.

We'd placed the built /dist contents in a subdirectory on an Apache (http, not https) server, ie. var/www/subdirectory. Prior to building, we'd configured relevant files as such from various forum threads:

build > config.js: publicPath: '/subdirectory' router > index.js: mode: 'history' app.js: require('offline-plugin/runtime').install(); .htaccess: https://router.vuejs.org/en/essentials/history-mode.html (See Apache config)

However, once relevant files are placed in the public subdirectory, the app returns a blank page, yet returns correctly when vue-router mode is set to 'hash'. No errors are found in the console.

Please let me know of further relevant information you may need in order to help resolve this issue.

Thank you!