Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #767891

    vendinimarketing
    Participant

    Hi there,

    My font-awesome icons no longer seem to be displaying. When I view source on my pages, I see this message:

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://vendini.co/wp-content/themes/x/framework/fonts/font_awesome/fontawesome-webfont.ttf?v=4.3.0.

    Do you know why this would be occurring and how I can get the font to load?

    My site: http://www.vendini.com

    Thanks!
    Joan

    #768234

    Lely
    Moderator

    Hi Joan,

    Please check this thread for FONT CROSS DOMAIN ISSUE:https://community.theme.co/forums/topic/x-shortcodesfontawesome-broken-in-firefox-after-v2-2-0-update/

    Hope this helps.

    #769735

    vendinimarketing
    Participant

    Thanks so much for this!

    I tried adding both of the code snippets mentioned in that thread:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    # Apache config
    <FilesMatch “.(eot|ttf|otf|woff|css)”>
    Header set Access-Control-Allow-Origin “http://cdn.vendini.com”

    AddType image/svg+xml svg svgz
    AddEncoding gzip svgz
    AddType application/vnd.ms-fontobject eot
    AddType font/truetype ttf
    AddType font/opentype otf
    AddType application/x-font-woff woff
    </FilesMatch>

    But I’m still seeing the issue in Firefox. The problem seems to be stemming from the fact that the original site that is built on the X theme is vendini.co and it gets forwarded to http://www.vendini.com. It seems that something is breaking between the two sites because the icon font loads fine on vendini.co.

    If you have any other ideas, I’d love to hear them! Thanks so much for your help.

    #770032

    Friech
    Moderator

    Hi There,

    Add this on top of your .htaccess file

    Header add Access-Control-Allow-Origin "*"
    Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
    Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"

    Similar to this:
    screenshot

    Let us know how it goes.

    Thanks!

    #771239

    vendinimarketing
    Participant

    Hi there,

    I added those three lines to what I already had and it’s still not working. Do I need to remove this part?

    # Apache config
    <FilesMatch “.(eot|ttf|otf|woff|css)”>
    Header set Access-Control-Allow-Origin “http://cdn.vendini.com”

    AddType image/svg+xml svg svgz
    AddEncoding gzip svgz
    AddType application/vnd.ms-fontobject eot
    AddType font/truetype ttf
    AddType font/opentype otf
    AddType application/x-font-woff woff
    </FilesMatch>

    #771428

    vendinimarketing
    Participant

    Yup. That did it. I removed the apache config stuff and it works now! Thanks so much for your help 🙂

    Header add Access-Control-Allow-Origin "*"
    Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
    Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    #771746

    Christopher
    Moderator

    You’re welcome.