How to restrict content of an IFrame to a particular domain from the iFrame - html

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.

Related

How to make iFrame behave exactly as if one were accessing the source site directly?

I am working on a site for a Client and they want to display the following URL in an iFrame:
https://www.vigrxplus.com/ct/3134
If you access that site directly, it will show the Promo code on the source website.
However, if you access that site via an iFrame, it will not show the Promo code on the source website:
https://jsfiddle.net/qc3zvo0b/
<iframe width="100%" height="1000" src="https://www.vigrxplus.com/ct/3134"></iframe>
(Make sure to test the iFrame without prior Cookies from having previously visited the source website directly.)
Attempting to enable all sandbox features for iFrame did not fix this.
The source site also seems to do some kind of redirect.
So how can this be fixed such that the iFrame behaves just like visiting the site directly?

Using Cross Domain Webpage on my Website

I am making a webpage on my website url of the page is as below.
http://www.hitechcaddservices.com/mechanical/design/engineering-design-automation/configure-your-product/
I am making an iFrame to display "https://configurator360.autodesk.com/743594009607818941/l1x6g1bxtfmg" on the webpage, this URL is created by my company to show product configuration to our clients.
I am not getting content on my website page due to X-Frame-Option issue (cross browser iFrame is not allowed). How i can make this iFrame working or is there any alternate way to display above given URL same way on my webpage.
Regards
Manoj Soni

iframe and frameset issue

I am using a free domain provider(freenom.com)
They provide us a url forwarding feature free of cost.
We can set our main website in iframe there.
My main website is : www.maleenes.com/shop/
&
Free domain website is: fashionary.ga
where main website is dispalyed in iframe.
My problem is that when you click on any link in iframe website then
I want it to change the url and navigate to the original website .
just like below reference website:
For example.
The Iframe is on dresswego.ga.
As soon as you click on something the url changes to original website wegodress.com
i want the same for my website fashionary.ga & www.maleenes.com/shop
Can anyone help me please/
Thanks
Web browsers does not allow to change the top most parent URL of page from cross domain Iframe.

Keeping links in an iframe in iframe

How does one keep all redirects from an iframe within the iframe? Sort of like a browser within the page. I've seen it done many times on translating sites, vpn sites, security sites, etc.
For Clarification: http://bit.ly/1m8EF4e
<-- Google translation of a wikipedia page. Notice how redirects are still within the iFrame of the translator.
<a href="(src)" target="_self"> for opening the link in a same iframe
for new tab change the targer value to _blank

Hyperlinks in a cloacked website

I have a website which is hosted via my providers webhosting.
I have bought another domainname and forwarded my current website to it.
The technique it uses is cloacking, so my old website is a frame in my new domain.
Everything works perfectly but when I click a hyperlink that goes outside the website (e.g. facebook page), the page won't show.
I have the following error in my Google Chrome console:
Refused to display Hyperlink in a frame because it set X-Frame-Options to DENY.
Any link, tutorial help will be appreciated.
The X-Frame-Options is submitted by pages if they don't want to be displayed in frame or iframe (see mdn: The X-Frame-Options response header)
The message tells you that Facebook tells the browser, that it does not want to be displayed in a frame. To solve this problem you need to set the target attribute for these links to _top or _parent. But be award that the user could prevent these options by browser extensions.
If you plan to use the second domain instead of the first one you should think over doing a 301 redirect. What you should avoid is to find a solution that displays the same content (without iframe) on both domains, because of double content.