CORS Policy Errors | WordPress.org

[ad_1]

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/

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer