I have a website that auto-redirects, using JavaScript, to a sub-domain when it detects the site is being viewed in a mobile browser. This sub-domain uses an iframe of the original site to ensure it looks good (long story, not worth getting in to). However, when redirected to the sub-domain, the iframe loads the entire page and ends up looping the redirect script, never actually loading the page. Is there any way to break out of this iframe loop? I’ve tried target=”_top”. Thanks.
I have a website that auto-redirects, using JavaScript, to a sub-domain when it detects
Share
check whether the page is loaded in an iframe before redirecting: