Refactor follow redirects

- Properly handles relative URIs upon redirects
- Prevents from endless redirect loops