douhe2305 2017-05-02 12:33
浏览 155

为什么我可以将wordpress admin嵌入到iframe中?

Hello to the whole community, as my question indicates, I would like to be able to insert an iframe in my portfolio (which is not a wordpress) and this iframe, I would like it to contain the page "www.mysite.com/wp-admin" but this does not work.

With the page "www.mysite.com", it works but not with the admin.

Several posts on this subject say that it is enough to add this:

Remove_action ('login_init', 'send_frame_options_header', 10, 0);
Remove_action ('admin_init', 'send_frame_options_header', 10, 0);

But it does not work either.

Somebody would have an idea?

  • 写回答

1条回答 默认 最新

  • dta43039 2017-05-02 17:23
    关注

    I first tried it on the same domain name and it worked, so I tested it with different domains and apparently it is not possible because of the following:

     "Refused to display 'www.mysite.com/wp-login.php' in a frame because it set 'X-Frame-Options' to 'sameorigin'."
    

    One solution could be editting your .htacces file:

    <IfModule mod_headers.c> Header unset X-Frame-Options Header always unset X-Frame-Options </IfModule>

    However I would recommend finding a total different solution to your problem, why you want to load your wp-admin in an iframe on another website in the first place?

    评论

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类