Redirect issues, sometimes it works, most of the times not

  1. open: How to Learn Polish Fast | Language Quest Blog | Learn Polish Fast
  2. click on post (see url)
  3. for example this post: How to Learn Polish Fast: Practical Tips for Beginners | Learn Polish Fast
  4. gets redirected to https://language-quest.top/post/how-to-learn-polish-fast
  5. but sometimes it redirects to How to Learn Polish Fast: Practical Tips for Beginners | Learn Polish Fast correctly (it seems to work when click directly on the url when linked on another site)

Why is this happening?
The url is correct when i click on it.

This is my astro js config

export default defineConfig({
  site: "https://language-quest.top/blog",
  base: "/blog",
  integrations: [tailwind(), mdx(), sitemap(), icon(),sitemap(), playformCompress()],
   image: {
    service: { entrypoint: 'astro/assets/services/sharp' },
  },
});

And this is my netlify.toml

[[redirects]]
  from = "/blog/*"
  to = "https://language-quest-blog.netlify.app/:splat"
  status = 200
  force = true

[[redirects]]
  from = "/polish-noun-cases/*"
  to = "https://polish-noun-declension.netlify.app/:splat"
  status = 200
  force = true

[[redirects]]
  from = "/polish-verb-conjugation/*"
  to = "https://polish-verb-conjugation.netlify.app/:splat"
  status = 200
  force = true

[[redirects]]
  from = "/app/*"
  to = "https://language-quest.netlify.app/:splat"
  status = 200
  force = true

I put this netlify.toml file in my main repository, do i need to add it to each repo?

I have multiple separate repositories that should be in subfolders. What may be wrong with my setup?

@jaroslaw91 You might be looking at your redirects in the wrong place.

If I follow your steps 1, 2 I see:

image

Starts at: https://language-quest.top/blog
Requests: /blog/post/how-to-learn-polish-fast
301’s to: /post/how-to-learn-polish-fast/
308’s to: /post/how-to-learn-polish-fast

But everything in your netlify.toml is a 200 status, which is a ‘rewrite’ not a ‘redirect’.

Check if you’ve got any redirects specified:

  • Elsewhere in the netlify.toml
  • In a _redirects file
  • In your astro code