Script to modify URL given certain parameters