Fix issues with redirects when there are spaces.