How to get rid of these duplicates?

How to get rid of this kind takes ?
There is a page of the website https://webpromoexperts.com.ua/online-obuchenie/ . Gives the response code of the server 200ок. However, if after the slash to add any numeric value (for example, https://webpromoexperts.com.ua/online-obuchenie/777) server also gives 200ок. How to make https://webpromoexperts.com.ua/online-obuchenie/777 gave a response code of 404 not found?
July 9th 19 at 10:13
1 answer
July 9th 19 at 10:15
This is due to the built-in ability to split post into pages <!--nextpage-->
Somehow I had this thing fix.
Don't remember exactly. In query has a parameter which shows the number of pages. I clung to the pre_get_posts hook (sort of) and checking if the page, if not then return 404.
More I will not recall, and access to the project where it did not.

Find more questions by tags WordPress