That seems like it should work to me, but looking at this thread there may be some limitations with rewrites to functions I wasn’t aware of:
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Access-Control-Allow-Origin Policy | 74 | 64018 | March 5, 2024 | |
| Redirect CORS issue | 3 | 1855 | October 11, 2022 | |
| Redirect to function on another Netlify site | 3 | 913 | November 8, 2020 | |
| Redirects effecting lambda functions | 13 | 2104 | August 14, 2019 | |
| Redirects to function endpoints not working using netlify cli "netlify dev" | 8 | 2438 | May 16, 2020 |