I have created a sub store in magento2, but on subdomain I'm getting below error in console.

Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "https://sub.domain.com" from accessing a cross-origin frame.  

at contents (https://domain.com/pub/static/version1525152785/frontend/Package/theme/en_US/jquery.js:3123:9)

Cross origin error coming for all js files.

For this I tried to change pub/static/.htaccess file to add Header always set Access-Control-Allow-Origin "*" but after this I'm getitng error Access-Control-Allow-Origin has multiple value '*, *

How to fix this issue?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.