Message Boards

How can I set up an iframe?

Alberto Gutierrez, modified 3 Years ago.

How can I set up an iframe?

New Member Posts: 13 Join Date: 5/18/20 Recent Posts

Hi everyone. 

 

Rigth now,  I have an iframe working perfeclty in my website. I need to updtate it, cause I need to show other page in it. So, I change the origin url and this message appears:

 

"The page -new origin url- has rejected the connection."

 

Searching in the logs I can´t see clearly which is the problem, so, how can I set up it properly? Thanks 

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: How can I set up an iframe?

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

Hi ,

Looks like the external url which ur using in iframe needs to allow ur website url for using it in iframe,by setting  header x-frame-options.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options 

Alberto Gutierrez, modified 3 Years ago.

RE: RE: How can I set up an iframe?

New Member Posts: 13 Join Date: 5/18/20 Recent Posts

Hi,

 

thanks for you reply by im adding this :

Header always set X-Frame-Options "SAMEORIGIN"

in the main Apache HTTP server configuration file by I dont apreciate any change(after a server restart). 

Am I setting up correctly? 

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: How can I set up an iframe?

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

As per the Header value "SAMEORIGIN"  is your website and the url which u are specifiying in iframe are same domain name ? If its same then the setting is correct. If domain name is changed then you may need to change setting as per that.

Alberto Gutierrez, modified 3 Years ago.

RE: RE: How can I set up an iframe?

New Member Posts: 13 Join Date: 5/18/20 Recent Posts

My website and the url which i am specifying in the frame aren´t in the same domain, so I´ve thought to add "allow-all" in the X-Frame-Options but I read that it doesn´t work on modern browsers.

 

How can I add a specif url permision in the X-Frame-Options??