-
Notifications
You must be signed in to change notification settings - Fork 414
Closed
Labels
area: command: devarea: redirectstype: bugcode to address defects in shipped codecode to address defects in shipped code
Description
Describe the bug
Splat redirects are always applied to matching paths, even if there's another matching path higher up. According to Rule processing order and Netlify deploy previews, only the first matching rule should be used.
This makes one site difficult to develop with because many URLs that are valid on Netlify are redirected to 404s.
To Reproduce
Visit localhost:8888/a
Configuration
[[redirects]]
from = "/a"
to = "/docs/a"
[[redirects]]
from = "/docs/*"
to = "/docs/b/:splat"
System:
OS: macOS 10.15.6
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 300.75 MB / 8.00 GB
Shell: 3.1.2 - /usr/local/bin/fish
Binaries:
Node: 14.9.0 - /usr/local/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
npmGlobalPackages:
netlify-cli: 2.61.2
Expected behavior
Should redirect to /docs/a
as Netlify only matches the first redirect
Actual behavior
Redirects to /docs/b/a
after incorrectly matching the splat redirect as well
Phebonacci
Metadata
Metadata
Assignees
Labels
area: command: devarea: redirectstype: bugcode to address defects in shipped codecode to address defects in shipped code