Fix for the redirect infinite loop.
Merge branch 'redirects'