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);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)