Move to pagination with URL parameters

I can not find the way to use URL parameters to define pagination pages /posts?page=2 instead of the conventional WordPress way /posts/page/2/

The goal is to make WordPress change the way it manages pagination, without breaking the website that is using the conventional WordPress permalinks format


and change the pagination to


I am happy also with this variant:


if necessary.