Handle ports for redirects.