Support » Plugin: WP Visual Icon Fonts » Fonts don't work from a cookie-free domain?

  • Resolved GermanKiwi


    Hi, do you know if it works to serve the web fonts from a “cookie free domain”?

    I just tried to impliment a feature in WordPress Core which lets you set the domain which cookies are served from, and thus also set a cookie-free domain for the static content, which should help with page performance. It’s recommended by the “YSlow” speed test, as well as by numerous WordPress tutorials like this one (Tip #1) and by Google themselves.

    So I registered a new sub-domain for myself ( – I’ll use “” as my domain name here). Then I added these two lines to my wp-config.php file as instructed in the tutorials:

    define('WP_CONTENT_URL', '');
    define('COOKIE_DOMAIN', '');

    Everything works perfectly fine on my website after this, with the sole exception of the Font Awesome fonts from this plugin – they don’t display at all!

    The path to the CSS file, which now appears in the <head> section of my pages, is correct and works:

    In trying to troubleshoot this, the first thing I did was open the wpvi-fa4.css file and change the font paths there, from:

    But that didn’t work.

    Then I changed the font paths in the wpvi-fa4.css file to:


    And then the fonts worked again! They were now displaying correctly on my website.

    So for some reason it seems the fonts don’t work when they are using the “static” URL, even though the URL itself is correct.

    But I have no idea why this would be so.

    I could change the URL of the CSS file to point to the BootstrapCDN path at // and this would work fine – and I believe this CDN server would also be cookie-free – so I don’t know why it fails when I use instead.

    Any ideas or thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • …BTW I’m not suggesting that there is necessarily something wrong with your plugin here! I’m just hoping you could help me troubleshoot this or give me some insight or a work-around or something. Maybe you know more about this topic than I do. 🙂

    Plugin Author Paul van Zyl



    I’m sure that know enough in rhis area particularly though I imigine there may either a path problem, or a cross origin policy issue, though I wouldn’t be able to help without doing a little research.

    I’ll leave this thread open for a while in case other users can help, though you may have more luck asking a more general question on stack overflow regarding cookie free domains and web fonts.

    Good luck!


    Ps: please post back here when you solve this.

    Hmm, you might be onto something with the cross origin thing – I’ll look into that and let you know if that helps.

    Yup, turns out it was caused by the “Cross-Origin Resource Sharing standard (CORS)”. Web fonts can’t be served from a different domain as the webpage, unless special permission is given by the web server to do so.

    This is described here:

    The same issue can also apply to images:

    I fixed it by adding a bit of text to my .htaccess file, which I copied from the HTML5 Boilerplate project’s sample .htacess file – as follows:

    # ------------------------------------------------------------------------------
    # | CORS-enabled images |
    # ------------------------------------------------------------------------------
    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>
            <FilesMatch "\.(cur|gif|ico|jpe?g|png|svgz?|webp)$">
                SetEnvIf Origin ":" IS_CORS
                Header set Access-Control-Allow-Origin "" env=IS_CORS
    # ------------------------------------------------------------------------------
    # | Web fonts access |
    # ------------------------------------------------------------------------------
    # Allow access from all domains for web fonts
    <IfModule mod_headers.c>
        <FilesMatch "\.(eot|otf|ttc|ttf|woff)$">
            Header set Access-Control-Allow-Origin ""

    This means that my new sub-domain “”, which is where the web-fonts are located and which is using this .htaccess file, will give permission for the fonts to be served to which is my main domain where WP is running. So the web pages at can contain links to the web fonts at and this will now work.

    Problem solved – thanks for helping me know where to look!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fonts don't work from a cookie-free domain?’ is closed to new replies.