Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alias for path should not be redirect #9620

Closed
maunier opened this issue Aug 2, 2021 · 3 comments
Closed

alias for path should not be redirect #9620

maunier opened this issue Aug 2, 2021 · 3 comments

Comments

@maunier
Copy link

maunier commented Aug 2, 2021

Versions

  • nuxt: v2.15.7
  • node: v12.16.2

Reproduction

Steps to reproduce

git clone https://github.com/maunier/test-nuxt.git
cd test-nuxt
npm run dev

I have code in nuxt.config.js:

router: {
    extendRoutes (routes) {
      routes.push({
        path: '/',
        alias: '/test'
      })
    }
  },

visit : http://localhost:3000/test

What is Expected?

expect path keep /test

What is actually happening?

redirect to http://localhost:3000/

Copy link
Member

@maunier It looks like you are adding another route, rather than modifying the existing route for path: '/'. Perhaps you could try finding the existing index route and changing it?

@maunier
Copy link
Author

maunier commented Aug 5, 2021

@maunier It looks like you are adding another route, rather than modifying the existing route for path: '/'. Perhaps you could try finding the existing index route and changing it?

nuxt 2.14.x is ok, it won't redirect

Copy link
Member

This should be resolved in Nuxt 2.15.8 with #9460.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants