Cookie-less domain and font loading issue
-
Hi,
I have a domain, let’s call it https://staging.site.com and all images and fonts are supposed to be served up from a cookie-less domain called https://media.site.com, which points to the wp-content folder:
https://staging.site.com/wp-contentThe images are working but the fonts are not. I have made changes to .htaccess to allow cross-origin assets to be loaded, however when the fonts are embedded in the page, they are being embedded using the wrong path:
Access to font at ‘https://media.site.com/wp-content/themes/pixxy/assets/fonts/ionicons.ttf?v=2.0.0’ from origin ‘https://staging.site.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
You can see that the URL still contains the /wp-content/ portion, which is incorrect.
The font IS accessible from https://media.site.com/themes/pixxy/assets/fonts/ionicons.ttf?v=2.0.0
For the moment, I have excluded all of the font-related CSS files from AO and that is showing them correctly, however this does expose a possible issue with AO whereby it is putting the incorrect prefix on the compressed files, ignoring the config for the cookie-less domain.
Has anyone there experienced this before? Is there a way to get it working so I don’t have to exclude the font-related CSS files from AO?
Many thanks in advance,
Anthony
- The topic ‘Cookie-less domain and font loading issue’ is closed to new replies.