SEO friendly query vars

At the end I made this work by using Javascript:

var currentURL = window.location.href;

var prettyURL = currentURL.replace('?', '').replace('state=", "').replace('&type=", "https://wordpress.stackexchange.com/");

window.history.replaceState({}, document.title, "https://wordpress.stackexchange.com/" + prettyURL);