Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
Vue 3 Application redirects to main domain from subdirectory and routes failed to work

can somebody suggest to me what is going wrong with my application here? I have a vue 3 SPA. I'm hosting it here for like

example.com/subdirectory/myapp/

It redirects to example.com after loading the app from the same path

example.com - redirected here with routes e.g example.com/create or example.com/delete

What I want to achieve is loading all routes from the subdirectory path like

example.com/subdirectory/myapp/create
example.com/subdirectory/myapp/delete

etc.

My vue.config.js code is as below:

module.exports = {
    publicPath: './',
};

My Routes code is as below:

import { createWebHistory, createRouter} from 'vue-router'

const routes = [
    {path: '/', name: 'list', component: () => import('@/views/List')},
    {path: '/create', name: 'create', component: () => import('@/views/Create')},
    {path: '/delete', name: 'delete', component: () => import('@/views/Delete')},
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router

Please guide me what is something wrong I'm doing here? I'm guessing it's something with my routing config for apache serving but what is that? I'm not able to figure it out.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda