Hello,
I am having a critical issue with a redirect rule that is not working as expected on my site. My goal is to protect a folder named “/app/” using Netlify Identity, so only logged-in users can access it.
My site:
- Site name: acesso-jornada30d
- Custom domain: acesso.jornada30d.com.br
- GitHub repo: (Cole aqui o link do seu repositório do GitHub)
What I have tried:
I have set up Netlify Identity and configured it to “Invite only”. My site structure is correct in the repository, with a login.html
file in the root and my protected content inside an /app/
folder.
1. Redirects Rule (netlify.toml
):
My netlify.toml
file has the following rule:
[[redirects]]
from = “/app/*”
to = “/login.html”
status = 302
force = true
conditions = {Role = [“member”]}
The Problem:
When I try to access https://acesso.jornada30d.com.br/app/
, it results in a “Page not found” error instead of redirecting to the login page.
Important Diagnostic Information:
- I can directly access my login page at
https://acesso.jornada30d.com.br/login.html
without any issues. The page and the identity widget load perfectly. - As a test, I changed the redirect rule to a simpler one:
from = "/teste"
andto = "/login.html"
. This test WORKED PERFECTLY. - This proves that the redirect engine is working on my site, and the
login.html
file is correctly deployed. The issue seems to be specifically with the more complex rule (/app/*
combined with the Role condition).
I have already tried using a _redirects
file, clearing cache, and redeploying multiple times. Nothing has worked. Could you please check the internal logs for my site to see why this specific redirect rule is failing?
Thank you for your help.