1

I want to use an iFrame to display the content of another web site (not mine) but I don't want to display other sites in that iFrame. For example, if the SRC for the iFrame is www.site.com then if a visitor clicks a link in that site that opens to another website, I want to prevent it and perhaps display a blank page or redirect back to the specified site.

The site hosting the iFrame uses Apache/PHP on a VPS.

I need to be able to restrict the iFrame content to what was originally specified. If this cannot be done using iFrame what else could work?

There is a similar post that does not work this way... only works on the content page and does nothing to prevent the host iFrame from controlling the content domain.

Community
  • 1
  • 1
WilliamK
  • 821
  • 1
  • 13
  • 32
  • Actually, you could probably do this with JavaScript or jQuery: http://stackoverflow.com/questions/19498725/control-iframe-content-with-javascript-html – SelfTaught Dec 24 '14 at 22:58
  • 1
    @Dillan — You couldn't. Cross origin security would prevent knowing where the iframe is pointing. – Quentin Dec 24 '14 at 23:02

0 Answers0