Join GitHub today
Fix Exact Redirect to work properly when using $rest keyword #4501
In #3965 we added the ability to use the
With these changes we can "deprecate a whole sub-path" by writing a Exact Redirect like this:
and all links pointing to the
Looks good. I remember that redirects also have some weird behavior with a leading
/, which might be worth investigating here also.
I particularly like the examples. It would probably be useful for us to provide more examples like this, particularly around cases that are common.
I just added a test for this to check how it behaves. I'm not sure what's the expected behavior here, but what it does sounds useless to me. Example:
What would be good use case for this? Should we validate the presence of the leading
I added some test cases and some validation at Form level to avoid people submitting malformed URL (missing leading/trailing slashes).
I suppose this is ready to merge once the tests pass.
A large project related to these changes is to have real redirects, not only on 404: #4550
I believe there are other redirects with similar problems. For example:
This will return
Just realized that we do support redirect to external URLs, so we need to support URLs starting with
I think this is deviating from the original purpose of the PR: fix the exact redirect with the usage of