This article covers how to enable CORS in the .htaccess file for sites experiencing Cross-Origin Resource Sharing errors.
The most common error is:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.something.com/wp-content/uploads/2017/07/icomoon/fonts/icomoon.ttf?fant1b. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)
Adding CORS to .htaccess
- Locate the Document Root of the domain
- Edit the .htaccess file and add the following line
TIP: The .htaccess file is hidden by default. Review the article on showing hidden files in file manager if unable to see the .htaccess file.
Header set Access-Control-Allow-Origin "*"
- Save the file and verify the error has been resolved
Comments
0 comments
Article is closed for comments.