how to intercept browser back button and send to a desired page with react router dom v6
I am developing an application in which there is a rule that on a specific page I need to intercept the browser’s back button and send it to another page other than the previous one.