If the server selected in the drop down is Test1 I need to alter the path for the page.
But i'm not sure to understand your use case. Do you mean that you do not know the server that will be hit in advance?
At which point do you want to modify the URL path? Is it in a middle of your script or at the beginning?