How to avoid Access-Control-Allow-Origin error using htaccess

How to avoid Access-Control-Allow-Origin error using htaccess

Add the below code in you .htaccess file.

#avoid Access-Control-Allow-Origin error using htaccess
<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>

Comments

Popular posts from this blog

Ionic framework Basics - 1

Most Useful .htaccess Tricks for WordPress website