Custom lettertypes worden niet geladen -bad URI or cross-site access not allowed
-
Ik heb een wordpress website via duplicator overgezet naar een andere host zonder problemen.
Volgende morgen ontdekken we dat sommige icoontjes (speciaal lettertype) niet willen inladen.In de console krijg ik deze meldingen
downloadable font: download failed (font-family: "ETmodules" style:normal weight:normal stretch:normal src index:1): bad URI or cross-site access not allowed source: http://daltix.com/wp-content/themes/Divi-3/core/admin/fonts/modules.ttf style.css:6058:12 downloadable font: download failed (font-family: "ETmonarch" style:normal weight:normal stretch:normal src index:1): bad URI or cross-site access not allowed source: http://daltix.com/wp-content/plugins/monarch/css/fonts/monarch.ttf style.css:59:12 downloadable font: download failed (font-family: "ETmodules" style:normal weight:normal stretch:normal src index:2): bad URI or cross-site access not allowed source: http://daltix.com/wp-content/themes/Divi-3/core/admin/fonts/modules.woff style.css:6058:12 downloadable font: download failed (font-family: "ETmonarch" style:normal weight:normal stretch:normal src index:2): bad URI or cross-site access not allowed source: http://daltix.com/wp-content/plugins/monarch/css/fonts/monarch.woff
(lettertypes staan op de host)
Na enkele uren googlen dacht ik een oplossing gevonden te hebben :
onderstaande code in de .htaccess schrijven<IfModule mod_headers.c> <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> <IfModule mod_mime.c> # Web fonts AddType application/font-woff woff AddType application/vnd.ms-fontobject eot # Browsers usually ignore the font MIME types and sniff the content, # however, Chrome shows a warning if other MIME types are used for the # following fonts. AddType application/x-font-ttf ttc ttf AddType font/opentype otf </IfModule> # rewrite www.example.com → example.com <IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] </IfModule>
Het leek perfect te werken, tot ik de subpagina’s bekeek. Nu hadden deze geen icoontjes meer. Terwijl ze zonder de ‘oplossing’ wel te zien zijn op subpagina’s.
Na een beetje experimenteren ondervond ik dat het onderste gedeelte van de ‘oplossing’ de switch maakt tussen
-GEEN icoontjes op Homepagina -> WEL op subpaginas
of
-WEL icoontjes op Homepagina -> GEEN op subpaginasEdit: ik kon niet inloggen op wp-admin, zonder het onderste gedeelte lukt het wel
Enige gedachten?
- Het onderwerp ‘Custom lettertypes worden niet geladen -bad URI or cross-site access not allowed’ is gesloten voor nieuwe reacties.