Overcoming “Display forbidden by X-Frame-Options”

后端 未结 26 2321
梦谈多话
梦谈多话 2020-11-21 06:31

I\'m writing a tiny webpage whose purpose is to frame a few other pages, simply to consolidate them into a single browser window for ease of viewing. A few of the pages I\'

26条回答
  •  春和景丽
    2020-11-21 07:12

    I tried nearly all suggestions. However, the only thing that really solved the issue was:

    1. Create an .htaccess in the same folder where your PHP file lies.

    2. Add this line to the htaccess:

      Header always unset X-Frame-Options

    Embedding the PHP by an iframe from another domain should work afterwards.

    Additionally you could add in the beginning of your PHP file:

    header('X-Frame-Options: ALLOW');
    

    Which was, however, not necessary in my case.

提交回复
热议问题