I'm using GeneratePress (GP) theme. They have default infinity scrolling feature. I am using this infinity scrolling instead of pagination.
But problem is when I go to homepage or category page and type /page/2/ (for example /page/2, it can be page 100) with domain name like domain.com/page/2/ or domain.com/category/bike/page/2/ still showing the result. But I want to remove these page I mean when anybody type this /page/2/ they will see page not found notice. How can I do that??