• Resolved shey18

    (@shey18)


    Hello,

    I recently noticed that the icons on a page (that is using this plugin) aren’t loading properly anymore. And the errors in the console says “CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource”. I don’t remember it being an issue previously though.

    I wanted to check if it may have something it do with the recent updates?

    Thank you!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Joeri van Veen

    (@ruigehond)

    Hello @shey18,

    Thank you for contacting me. I noticed this with another (new) site as well, I will investigate if this has to do with the update, although I cannot think why currently.

    In the meantime, can you check if the #ruigehond007 block is (still) present in your .htaccess (in the root), and only once? I added ‘woff2’ to the extensions in this update. If it is present twice please remove the one without woff2 and let me know, that would be an unintended side effect of the update.

    This is the required block (including woff2):

    # BEGIN ruigehond007
    <IfModule mod_headers.c>
    <FilesMatch ".(eot|ttf|otf|woff|woff2)$">
    Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
    </IfModule>
    # END ruigehond007

    hey @shey18,

    I hope this message finds you well. I understand that you’ve been encountering a CORS issue with the plugin, and I’m here to offer a solution that has successfully resolved the same problem for me.

    The CORS (Cross-Origin Resource Sharing) issue, which leads to some elements like Elementor fonts being blocked on the second domain, can be addressed by enabling the “headers” module in your Apache server configuration.

    To enable the “headers” module, you can use the following command in your terminal:

    “sudo a2enmod headers”

    This command will activate the headers module and allow you to set custom response headers, including those required to handle CORS errors effectively.

    After enabling the “headers” module, don’t forget to restart Apache for the changes to take effect:

    “sudo service apache2 restart”

    Once you’ve completed these steps, please check your website again to see if the CORS issue has been resolved. The missing elements, such as Elementor fonts, should now display correctly on the second domain.

    I hope this solution proves helpful in resolving the CORS problem you encountered with the “Each Domain a Page” plugin.

    Best wishes for a smooth and successful resolution.

    Thread Starter shey18

    (@shey18)

    Thank you both @ruigehond @amujain22 for your input!!

    My site is hosted in SiteGround. Apparently, I needed to deactivate the NGINX Direct Delivery in order for the rule in .htaccess to work.

    More info here: https://world.siteground.com/kb/cross-origin-resource-sharing-cors/

    Plugin Author Joeri van Veen

    (@ruigehond)

    Thank you for sharing that information!
    Indeed NGINX does not process .htaccess files as standard. It works fastest if it doesn’t, but then you would have to configure these things in the main config. Of course, plugins do not have access to that. I will mention this in the documentation of my plugin in a future version. Thank you again for sharing the information and the link.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CORS Policy Errors’ is closed to new replies.