Skip to main content

Posts

Showing posts from March, 2021

Deploy Vue JS app in subfolder in apache webserver

Introduction: Deploying Vue Js build to the root path in any web server is everyone known thing. But when it comes to deploying it in a subfolder of your webserver is a little bit headache. The reason is when we configure the subfolder path in the Vue app. It can control the routing in the front end. But it can't go to the correct page when it gets refreshed as it is a front end app. In this article, you can learn how to set up in Vue app configuration for front-end and apache configuration to set up in the backend. So that your app can run without any page not found error when the users refresh your Vue app. STEP 1: Setting up in the Vue app. change the publicPath in your Vue Js config file. ( /vue.config.js ) module.exports = {   publicPath:  '/subfolder-name/' ,   assetsDir:  '' } make sure you have added slash in front and back. Go to your Vue JS router file. ( /src/router/index.js ) make the below changes for subfolder routing in the front-end. mode should be h