javascript - How to limit display of iframe from an external site to specific domains only -
i operate service client's content prepared , displayed in iframe. client copies rudimentary iframe html tag , pastes web page. clients complain other websites copying iframe tag , pasting sites.
is possible restrict display of iframe's content specific domain or domains? perhaps programmatically telling iframe parent must some-domain.com or else don't display.
does make sense? can verbose.
you can use .htaccess (assuming original content on apache server) limit access specific ip.
or, if page php, limit specific domain, this:
<?php $continue = 0; if(isset($_server['http_referer'])) { //correct domain: $ar=parse_url($_server['http_referer']); if( strpos($ar['host'], 'yourdomain.com') === false ){ } else { $continue = 1; } } if($continue == 0){ header('http/1.0 403 forbidden'); exit('forbidden'); } ?>
Comments
Post a Comment