Regarding redirect function

Hey ,
I just migrated my app to AWS . there , I am facing the redirection URL issue. I don’t know why is this happening. In local it was working fine.
i am sharing the redirected url from production

patients/edit-caregivers?url=patients%2Fedit-caregivers