Manipulating URL parameters
It's good to follow the single responsibility principle. The current method does many things that would make sense to extract to smaller helper functions, for example:


convert query string to dictionary
concert dictionary to query string
delete list of keys from dictionary
... and so on


What's the point? Next time you need something similar (and most certainly you will), you will be able to reuse the common elements easier.

And yeah, as @Quill said, the names are horrible. Some ideas:


params instead of para_dict
index instead of ii
key_value instead of tmp
url instead of pathname