Fix logic error in home-page template. Add trim to url-shortening and wrap redirect to check for scheme