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 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译
  • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
  • ¥15 扩散模型sd.webui使用时报错“Nonetype”
  • ¥15 stm32流水灯+呼吸灯+外部中断按键
  • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符