How to remove ?i=1

Just came up with this in mind:

<script>
const r = new URL(window.location.href);
r.searchParams.delete('i');
history.pushState({}, '', r.href);
</script>

Just put this somewhere in the header or footer, no extra config required, no apache htaccess whatsoever, no extra hits to the server, does not conflict with other parameters in URL.


Thanks @oxy for helping spotted my typo :joy:

4 Likes