• Resolved obtenmiweb

    (@obtenmiweb)


    Hi,

    The set-up went well but the snippet to fix the CORS Policy error didn’t do it.

    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css)$">
    <IfModule mod_headers.c>
    Header add Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Origin "*"
    </IfModule>
    </FilesMatch>

    Part of my htaccess file looks like this:

    # 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>
    <IfModule mod_php7.c>
        php_value memory_limit 256M
    </IfModule>
    # END WordPress
    # BEGIN AWS CDN 
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css)$">
    <IfModule mod_headers.c>
    Header add Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Origin "*"
    </IfModule>
    </FilesMatch>
    # END AWS CDN 

    This is one of the tutorials I followed for the AWS Setup:
    Setup AWS CloudFront for WordPress

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author luckychingi

    (@luckychingi)

    Thread Starter obtenmiweb

    (@obtenmiweb)

    Added the following to .htaccess as it says in the Github repository and still get CORS error.

    # END WordPress
    AddType font/ttf                         ttf
    AddType font/otf                         otf
    AddType font/woff                        woff
    AddType font/woff2                       woff2
    AddType application/vnd.ms-fontobject    eot
    <FilesMatch ".(eot|ttf|otf|woff|woff2)">
      Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
    

    The log I’m getting is the following:
    SEC7120: [CORS] The origin 'https://domainname.com' did not find 'https://domainname.com' in the Access-Control-Allow-Origin response header for cross-origin font resource at 'https://d1wwhmx7g3g9x.cloudfront.net/wp-content/plugins/theme-addons/assets/fonts/Linearicons.ttf?fgpewa'.

    • This reply was modified 5 years, 2 months ago by obtenmiweb.
    Plugin Author luckychingi

    (@luckychingi)

    Which icons aren’t showing on the site?

    I didnt see any error in the dev console

    Thread Starter obtenmiweb

    (@obtenmiweb)

    I replaced the real domain name in my last reply. The icons that are not showing up are in the main menu of my site. Here’s a list of all the CORS errors:

    Here‘s cloudfront pointing to my domain.

    • This reply was modified 5 years, 2 months ago by obtenmiweb.
    Plugin Author luckychingi

    (@luckychingi)

    https://ibb.co/ct1S5xP

    I can see the icons here on my computer.

    Plugin Author luckychingi

    (@luckychingi)

    Marking this as resolved as icons are visible on the website

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘CORS Solution not working’ is closed to new replies.