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

How To Install XAMPP/LAMPP Stack On Ubuntu 16.04 64bit Step by Step

Most Useful .htaccess Tricks for WordPress website