X-Frame options sameorigin issue

2.4k views Asked by At

I need to show a mautic form on my wordpress website. Hosting environment is AWS Lightsail. Form is showing properly but when click on submit button, it is not submitting and page keeps as it is. When i checked the developer console of Chrome browser, i could see this.

Refused to display 'mydomainip/form/submit?formId=1' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

I discovered for apache httpd.conf file in AWS's apache. In the header module section, I could see the current code is,

Header always append X-Frame-Options SAMEORIGIN

So i changed it to,

X-Frame-Options: ALLOW-FROM https://mymauticdomainip.com/

But still it not works. I'm really stuck here and please someone help me to solve this.

1

There are 1 answers

0
MajesteitBart On

Might be nothing, but on the google cloud I went to /opt/bitnami/apache2/conf/httpd.conf and changed it to this, now it works:

<IfVersion >= 2.4.7 >
    Header always setifempty X-Frame-Options "ALLOW-FROM https://example.com"

</IfVersion>
<IfVersion < 2.4.7 >
    Header always merge X-Frame-Options "ALLOW-FROM https://example.com"
</IfVersion>