After login if user press back button error appears, Nextjs App

I have tried to set Custom error page but it wont allowing me to set my localhost:300 url as the project is still in production face i dont have a domain for it.

is there any way i can set localhost:300/MyErrorPage as an custom error page?