_redirects not working when edge function exists

We have a website built on astro that hosts a range of dynamic pages on url /tutor/* eg (tutor/gcse) and an edge function is associated with it.

Previously we had static pages at say /tutor/gcse-maths and we have used to the same everywhere on social media. Now since these pages have been moved to tutor/maths/gsce we tried to add a record in _redirects file similar to this

/tutors/gcse-maths https://edumentors.co.uk/tutors/maths/gcse 301!

But this seems to be not working. Even tried changing it to 200! but it seems to be hitting the edge function for /tutors/* which redirects to a 404 page.

Any help to solve the issue is appreciated and thanks in advance.

netlify deploy link: https://64c27f193d8e8c0008733dce--edumentors-landing.netlify.app

hi there, before we dig in, did you see this brand new guide on debugging redirects?

I strongly suggest you give it a thorough read through and see if this fixes your problem:

if not, please post again, and we’ll try and troubleshoot.

Hello. I have gone through the suggestions and from the look of it, it seems that I have done it properly. I have a redirect rule for /tutors/* which points to an edge function. and a redirect rule with a 301! for /tutors/gcse-maths/ which is before the /tutors/* rule in the _redirects file of the deployed website. But still it seems to me like the /tutors/gcse-maths rule is not getting processed.

This is expected. Edge Functions take over redirects. Use Astro’s redirects instead.