How to resolve `Access Control Allow Origin` Error

21

December 2021

While URL Rewriting most of the time developer face issue of `Access-Control-Allow-Origin` to solve this issue read this article below.

First Step:

Add base url in your file header tag.

syntax =>  <base href="https://www.fastyget.com/">

Second Step:

Identidy in which file this error occur and blocked by access control origin.

if file is in main folder then you will add code in your main .htaccess file. if your error related to js files then you will add new ,htaccess file and add code which i mentioned below for js same for css and font folders.

Main file issue:


    Header set Access-Control-Allow-Origin "https://yoururl.com/"

JS file issue:


    Header set Access-Control-Allow-Origin "https://yoururl.com/"

CSS file issue:


    Header set Access-Control-Allow-Origin "https://yoururl.com/"

Font file issue:


    Header set Access-Control-Allow-Origin "https://yoururl.com/"

 

Thanks for reading this article if you have any question then comment below.

ARFASOFTECH

author

ARFASOFTECH Admin, Author

What separates good content from great content is a willingness to take risks and push the envelope.

Comments (0)

Leave a comment