CDN Sosyal Ağ Simgelerinin Görünmemesi

SeLoReWebmaster Yorum Yaz

CDN Sosyal Ağ Simgelerinin Görünmemesi

Sitemiz için bir CDN servisi kullandığımda bu sosyal ağ simgelerinin yani Font Awesome Icons'ların görünmemesine veya bozulmasına sebebiyet verebilir. bunun çözümü için bu kodları sitemizin .htaccess dosyasına ekliyoruz.

# ----------------------------------------------------------------------
# CORS-enabled images (@crossorigin)
# ----------------------------------------------------------------------
# Send CORS headers if browsers request them; enabled by default for images.
# developer.mozilla.org/en/CORS_Enabled_Image
# blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
# hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
# wiki.mozilla.org/Security/Reviews/crossoriginAttribute
<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    # mod_headers, y u no match by Content-Type?!
    <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">
      SetEnvIf Origin ":" IS_CORS
      Header set Access-Control-Allow-Origin "*" env=IS_CORS
    </FilesMatch>
  </IfModule>
</IfModule>
# ----------------------------------------------------------------------
# Webfont access
# ----------------------------------------------------------------------
# Allow access from all domains for webfonts.
# Alternatively you could only whitelist your
# subdomains like "subdomain.example.com".
<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>

NginX için bu kodu ekleyin

location ~ \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin "*";
}

Kodları ekledikten sonra hemen olmayacaktır. Cache eklentimizden cache temizliği yapıyoruz vede CDN servisimizden de cache temizliği yapıyoruz ve düzeliyor.

Yazar Hakkında

SeLoRe

Facebook Twitter

Herhangi bir konuda sorunuz varsa soru-cevap bölümünden sorabilirsiniz. İstek, şikayet ve önerilerinizi iletişim bölümünden yazabilirsiniz.

Abone Ol
Bildir
guest

0 Yorum
Inline Feedbacks
View all comments