I’ve been looking through the support docs and confused on role based redirect. I’m looking to add this feature into my site and testing it locally with netlify dev (I have a hugo site).
The redirect rule is as follows:
/en/membership/coreskills/* /en/membership/coreskills/:splat 200! Role=CORESKILLS
/en/membership/coreskills/* /en/membership 301!
When I try to go to a link under /en/membership/coreskills/, I get redirected back to the membership page. This behavior happens both when I’m logged in and logged out. The netlify cli output is
Redirecting /.netlify/non-existent-path to /en/membership
I removed the bottom rule and get redirected to page not found. The outcome is the same if I remove the :splat then the entire ‘to’ path altogether. This behavior happens both when I’m logged in and logged out. No cli output.
I removed the role condition, and I get a blank screen. The netlify cli gives the output
Rewrote URL to /en/membership/coreskills/coreskills-1/index.html
I change the rule to
/en/membership/coreskills/* /en/about 200!
and it also gives me a blank page with the netlify cli output
Rewrote URL to /en/about/index.html
Finally I change the rule to
/en/membership/coreskills/* /en/about 301!
and it redirects to the correct about page with the netlify cli output
Redirecting /en/membership/coreskills/coreskills-1/index.html to /en/about
Any idea on what is happening here? I see that identity knows that I am logged in with the correct role. What path does the 200 rule try to direct to?
Any help much appreciated
Thanks in advance