I have some parameters in url that are added when coming to a specific page, so correct page is opened. For example: https://example.com/index.php?cCode=SFI=&cmpn=cHJvdmlkaW8= Now, when i get to that page, i want to remove them, so they don't get passed further, but still want to keep any additional parameters, like source=facebook or whatever... I found a way to remove them with this code:
var urlParts = url.split('?');
var params = new URLSearchParams(urlParts[1]);
params.delete('cCode');
params.delete('cmpn');
var newUrl = urlParts[0] + '?' + params.toString();
history.pushState(null, null, newUrl);
But they still get forwarded when i click on a some link... Any way to do this, with js or even php?