Helmi
Helmi

Reputation: 539

Folders in nuxt render on two URLs

I'm using dynamic folders in the style of

_category/index.vue
_category/_post.vue

so example.com/examplecategory renders the category overview page and example.com/examplecategory/posttitle renders the post. This works well.

Unfortunately example.com/examplecategy/ (note the trailing slash) renders the same content as the url without the slash at the end.

There's two problems with that:

Is there any easy way to redirect one version to the other? For the GA module it looks like the version with the slash would be the one to go even thought I would prefer to have no trailing slashes at all and I think this is generally the prefered way.

Any help on that end is appreciated.

Upvotes: 1

Views: 604

Answers (1)

Aldarund
Aldarund

Reputation: 17621

You can use nuxt-trailing-slash module

or you can do a redirect the server that you are using like nginx or whatever

Upvotes: 0

Related Questions