Static GitHub Issues

[1680] How to get slashes in routes working without dynamic nesting

prev: NUXT + Firebase Authentication
next: hwo to set each page rendered by server

Please. Anyone. Just one working example of how to route urls with more than one slash (for the route itself). I spent a Sunday on this but no luck.

I'm using Nuxt as a central part in building a customized and server side rendered MEVN stack (the N might as well stand for Nuxt).

For the sake of the future I would really like to keep a url structure with domain/route/category/subcategory/slug - the name of the controlling route being permlink.

Dynamic nested routes haven't been any success, though.

As an alternative some hacks with encodeURIComponent(someurl) and decodeURIComponent(someurl) have been tested. This seems closer, but still no breakthrough. Perhaps it's just a matter of putting the encodes and decodes right.

Works: http://localhost:8085/permlink/tyskland-baenkesaet-test-med-tags-jan Works: http://localhost:8085/permlink/england%2Fjord%2Ftester-med-fast-ord-testord 404: http://localhost:8085/permlink/england/jord/tester-med-fast-ord-testord 404: http://localhost:8085/permlink/udvandrerne/baenke-drastisk-udrensning-fremhaever-vigtigt

Then I've tested the extendRoutes way. After the best of my abilities I've sucked a lot up up from 1592, 1542, 1234, 1032, 275, 112 among others.

Only result is still 404, when it comes to the urls including slashes after /permlink. Have also tested without the dynamic component \pages\permlink\_permlink.vue to give "more room" for the extended route - but same same.

Please take a look at one of all my tested configurations in nuxt.config.js:

    router: {
        extendRoutes (routes, resolve) {
          routes.push({
            name: 'permlinkindex',
            path: '*',
            component: resolve(__dirname, '~/pages/permlinkindex.vue')
          })
        }
      },

Is this simply caused by a bug with backslashes in windows?

My setup:

  • Windows 10
  • NPM 5.3.0
  • Node 8.1.2
  • Nuxt 1.0.0-rc11

Any help - or just a little push - would be much appreciated.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1503">#c1503</a>)</em></sub></div>