Warning while parsing _redirects file

I’m trying to redirect users of my page who aren’t logged in away from a /checkout.html page back to the main index /.
So I created the following _redirects file:

/checkout.html 200! Role=free
/checkout.html 200! Role=premium
/checkout.html / 401!

but when running netlify dev I get the following error.

Warnings while parsing _redirects file:
1: /checkout.html 200! Role=free -- undefined
2: /checkout.html 200! Role=premium -- undefined

I’m not sure what’s undefined here?
Help would be greatly appreciated!

I’ve tried multiple other things that weren’t successful unfortunately.

This one didn’t seem to trigger at all (no warnings on running netlify dev however)

/checkout.html /checkout.html Role=free,premium
/checkout.html / 

I also tried the following to at least prove that basic redirecting is working

/checkout.html https://www.google.com

That works for the server that’s spun up at http://localhost:8888/checkout.html, but not for I’m not sure why And as soon as I add a role check to it. It no longer seems to trigger.

You realize that both localhost and are on your computer and not on Netlify, right?

Ofcourse :joy: I assumed the dev server would mimic the behaviour. But I also tested the mentioned redirects on a deployment :).
I now have the following deployed:

/checkout.html /checkout.html 200! Role=premium
/checkout.html /checkout.html 200! Role=free
/checkout.html / 200!
/checkout /checkout 200! Role=premium
/checkout /checkout 200! Role=free
/checkout / 200!

But now I can’t go to the checkout page even as the user with the correct role. I just get redirected to the index

Edit: Could it be that it takes a while for the redirects to take effect? I tried the same deployment a few minutes later and it seems to work now! Logging out and in breaks it again though. It seems quite unreliable.

It seems to be a caching related problem. Since after a few minutes of being logged in I can access the checkout page again. But right after logging in, I can’t not sure what’s causing that though.

hi there, i know this is mostly resolved, but i wanted to be sure you saw our redirects support guide in case there was anything in there that was helpful to you?