Updated to properly use parse_url()

Switch to using parse_url(), so the destination will only be changed when no scheme is set.