when I run npm run generate (which is the build command I’ve configured netlify to use) locally the routes are simply: /post-slug-here.
In netlify’s deploy details in the “new pages include” list I get: what-is-financial-literacy/index.html which is correct - the slug of one of my blog posts made using NetlifyCMS.
The issue
When I go to my live, deployed site: https://www.wealthampd.com/blog/, the posts listed are linking to /blog/post-slug-here as opposed to just /post-slug-here so they’re 404ing.
For transparency I’m using the NuxtLink component on the blog index page:
like so:
<NuxtLink :to="post.slug">Read more</NuxtLink>
What is really odd though, is if you go to an individual post e.g.
and then go back to the blog index page, the links will be pointing to the correct place…
Spooky, right?
The end
Sorry that this is so rambly, but I’m completely lost as to what is going on here. I might be completely missing the point and I’m not 100% sure this is a netlify problem or a nuxt problem or a me problem. Thanks for reading
This rule will also catch /blog/, which is the main blog page.
You can add a redirect rule above this: /blog /blog 200! as redirects are read chronologically.
Otherwise, I think you’ll want to check out the Nuxt configuration as to why they’re sitting under /blog in the first instance. It may be related to this setting but, alas, my knowledge of Nuxt is limited!