Don't recurse forever when a page redirects to itself

Change-Id: I8a3a0eaeb52f7c3bee6e62b2a4241fe20513a430