3

I can't find the option to enable this confiuguration on Magento 2:

allow magento frontend to run in frame

on magento 1 was in system > configuration > admin > security

This old post shows how to do on magento 1: old post

1 Answer 1

3

Open the env.php file and put

'x-frame-options' => 'SAMEORIGIN',

Magento wants this in env.php because they claim that it’s more secure than setting a value in the Magento Admin.

Possible values for x-frame-options are three

DENY It prevents your site page from being included in an iFrame.

SAMEORIGIN If a parent page is from the same domain as your site page, the site page can be included in the iFrame.

ALLOW-FROM You can specify a single URI that is allowed to frame your site page e.g. ALLOW-FROM http://www.somedomain.com/

Add asterisk If you add an asterisk 'x-frame-options' => '*' it will allow all domains to access your Magento URL in the iframe. NOT RECOMMENDED BUT WORKING

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.