Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How can I set up an iframe?
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
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
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?
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.
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??
Powered by Liferay™