You will need to display the links using the correct URL scrolling for this to happen. This is a design decision that you will need to make at the end, depending on the configuration of your system.
I have several sites that have this problem, and what I am doing is setting up a global query variable that sets the current page data at the top of the page request.
Then, when I draw the page, if I need to use the current query string, I do something like:
echo '<a href="myurl.php' . querystring . '&bar=foo';
This is not the cleanest, but it all depends on how your system works.
source share