:id urls not working in React App after deployment

Hi everyone,

I am struggling with rendering my pages after deployment of my React App. On localhost everything runs fine, yet after deploying, this exact route doesn’t work anymore:

<Route exact path='/superhelden/:id' component={RetreatDetails2}/>

In my redirects file I have the following defined:

/* /index.html 200 and in my react App I have ```

So, whenever I now try to open e.g. www.mywebsite.com/superhelden/2 I get redirected to www.mywebsite.com/welcome because it apparently doesn’t know the route. I have already tried a lot of different things like adding to my _redirects:

/ superhelden=:id /superhelden/:id 301 or /superhelden=:id /superhelden/id or query = {id = ":id"} or /superhelden/id=:id /superhelden/id 301 or /superhelden/* /superhelden/:id

So far, nothing ist working. Could you please help me out? I also didn’t find help in the forum nor in the redirects documentation by netlify.

Thanks a lot in advance!

Hey, welcome! Is the _redirects file in your published directory (not your root) and can you confirm that Netlify is picking up that redirect rule? You’ll be able to tell in your “Deploy Summary” located here (where YOUR_SITE and DEPLOY_ID are specific to your account): https://app.netlify.com/sites/YOUR_SITE/deploys/DEPLOY_ID