Interesting, thanks. One last thought before I ask to create a bug report issue - 301 redirects are cached by the browser permanently. Maybe there is a previous test session “hardcoded” in browser cache. Can you test with different empty-cache (incognito) browsers to verify and rule that out?
Files take priority over redirects. If a file exists on disk, GitLab Pages serves the file instead of your redirect. For example, if the files hello.html and world.html exist, and the _redirects file contains the following line, the redirect is ignored because hello.html exists:
GitLab does not support Netlify force option to change this behavior.
This explains everything. and at the same time, it doesn’t really solve much
Honestly — that makes the feature far less useful. It does not work as a solution for domain canonicalization (www → apex, subdomain → path, etc.). And I don’t really see real-world scenarios where domain-level redirects would be effective under these limitations.
Glad you found the root cause. I don’t know exactly how GitLab Pages are implemented, need to defer what I found in the docs. I’d suggest opening an issue with your proposal and feedback, linking this topic and discuss with engineers