添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I would like to let other website owners display pages from my site on their site.
I checked the .htaccess of my site but couldn’t find any code line preventing my site to show in an iframe, but when I try to iframe the pages I get an error.
I found out that there are 3 options:
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM https://example.com/
But I couldn’t figure out how to use one of those lines and where to insert it (I prefer the third one where I can decide who can iframe my pages).

The page I need help with: [ log in to see the link]

Hi @progameinc
This is more a question about Apache than about WordPress.

You can’t display your website inside an iframe outside your domain name because your site has this header in place
x-frame-options: SAMEORIGIN
Screenshot: https://i.imgur.com/BYC45ox.jpg

You can try adding this to your .htaccess file:

Header always unset X-Frame-Options Header set Content-Security-Policy "frame-ancestors 'self' https://www.example.org"

The first rule will unset the X-Frame-Options, we are doing this because this header is no longer supported in newer browsers.

With the second rule, we are indicating that the pages can be framed in the same domain and in https://www.example.org domain. Replace example.org for the desired domain where your site will be framed.

Let me know if this works for you.

If you want to know more, here are a few links:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors