Fixed url redirection so that it handles urls that only contain the portal and no trailing forward slash