Detect whether in an iframe and redirect accordingly