Identity redirects in starter tier

Site: https://jocular-puffpuff-5cd119.netlify.app

I have setup the above site so the link test netlify | test netlify should only be seen by a logged in user. I have enabled netlify identity of course and created some users/roles.

The website is built with vitepress and I tested both a netlify.toml file in the root of the repository with the following redirect syntax:

[[redirects]]
  from = "/doc/*"
  to = "/doc/:splat"
  force = true
  status = 200
  conditions = {Role = ["user", "admin"]}

and then I tested by using a _redirects file with the following syntax:

/doc/*   /doc/:splat  200!  Role=user,admin

In both cases, regardless I am logged out or logged in I can visit test netlify | test netlify and I can see the text that I am not supposed to see if I am logged out PLUS a 404 that is injected in the main content.

Are redirects actually working in the starter tier? am I doing something wrong?

Any help is hugely appreciated.

hi there, before we dig in, did you see this brand new guide on debugging redirects?

I strongly suggest you give it a thorough read through and see if this fixes your problem:

if not, please post again, and we’ll try and troubleshoot.

Hi @SamO, I did read that documentation prior to posting. Anyway, I solved it by adding a second redirect (301) for the same path for non authorized users that redirects to a login page, the following code in netlify.toml works:

[[redirects]]
  from = "/doc/*"
  to = "/doc/:splat"
  force = true
  status = 200
  conditions = {Role = ["user", "admin"]}

[[redirects]]
  from = "/doc/*"
  to = "/login/login"
  force = true
  status = 301

awesome thanks for coming back and sharing that solution with the community!