Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have just migrated a WordPress website from HTTP to HTTPS and few pages are not migrated properly because the content is blocked due to CORS policy. the problem is two sources to qualify CORS policy error are from the same domain but just its different in security level one is HTTPS and another is HTTP.

Access to Font at 'https://kitabee.in/wp-content/themes/academia/dist/fonts/montserrat/montserrat-regular-webfont.woff2' from origin 'http://kitabee.in' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://kitabee.in' is therefore not allowed access.


How to fix?

What I have tried:

I have searched on google and stackoverflow but everyone is providing tutorial either about "how to migrate WordPress site to https" or "how to fix CORS issue".

I tried myself searching in the code where I can change the link to https so the origin becomes same but unable to locate the location.

Please suggest where in the code or WordPress admin panel I should fix this
Posted
Updated 28-Oct-17 2:25am

1 solution

Don't have absolute links to resources (ie ones that have the domain in them too), use ones like '/wp-content/themes/academia/dist/fonts/montserrat/montserrat-regular-webfont.woff2' instead. That way it will use the same domain and protocol that the page requesting it is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900