Added logic to trim the trailing slash on legacy redirect URLs.