Avoid redirecting loop to same URL

Fixes #89