You cannot cause URL redirect simply by having what you're calling a "query string" in the URL. If there is redirecting happening, that is being handled by the server itself.
What is actually happening is as follows:
1. User visits URL with the query string.
2. Server acquires the query string (id=XAJDJAXSD) from the URL that the user visited via GET http verb, and operates on it (maybe database search or simply generating a redirect url)
3. Generates a redirect url
4. Returns a server response by redirecting the user to the new URL.
So if you're using PHP. There should be a way to generate a link from the given URL query, try Stackoverflow for programming help.
Best of luck.