I am wondering if I can set a redirect at a URL (This part can be done easily I know v).
But this redirect ONLY actually redirects, when the URL is visited. Not when the URL is displayed within an iFrame.
Can this be done at all? Essentially; Visit said URL with redirect implemented in the header; web page redirects to the defined. BUT, a website using that said URL within a iFrame call, it does not redirect.
Basically a page via URL only really accessible & viewable via an iFrame call.
This is possible via client-side. If you add following code to page onload
event:
if (location.href == top.location.href) location.href='http://your_new_url';
the page will redirect to new URL only if it is called as top-level page. If it is called within an IFRAME - the condition will be false and redirect will not happen.