voorhoede / head-start

Base setup on top of headless services to help you quickly start a new website
ISC License
4 stars 0 forks source link

Editable redirects no longer work #162

Closed jbmoelker closed 1 month ago

jbmoelker commented 3 months ago

@Siilwyn and I encountered editable redirects no longer work. The cause is unknown.

This could have been caused by:

Redirects defined in the _redirects file are not applied to requests served by Functions, even if the Function route matches the URL pattern. If your Pages application uses Functions, you must migrate any behaviors from the _redirects file to the code in the appropriate /functions route, or exclude the route from Functions.

jbmoelker commented 3 months ago

Cloudflare _redirects are based on Netlify _redirects. So we could stick with this format for rewrites and use the netlify-redirect-parser in a catch all route or middleware.

jbmoelker commented 1 month ago

Maybe better to switch to our own (meaning not Cloudlare/Netlify), more explainable syntax and use a better documented package like https://github.com/lukeed/regexparam or https://www.npmjs.com/package/tiny-request-router