Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

A WordPress installation using http://www.example.com/blog shows a wrong font (and due to that a wrong layout) whereas using http://example.com/blog shows the correct font and layout.

This happens on Firefox and IE9. Chrome and IE8 do not behave like this.

I'm at a total loss about the possible causes for this, could you enlighten me?

share|improve this question

migrated from webapps.stackexchange.com Apr 10 '12 at 9:00

This question came from our site for power users of web applications.

add comment

1 Answer 1

up vote 5 down vote accepted

Updated based on the comment provided by @Lèsemajesté

This happens because FF and IE9 have chosen to implement an anti-cross-domain DRM mechanism for web fonts.

I fixed it by using the following code in my htaccess file to pin the site to a single domain no matter which version of a url it's accessed from (this also seemed useful from an SEO point of view).

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.org.uk$ [NC]
RewriteRule ^(.*)$ http://www.domain.org.uk/$1 [R=301,L]

You can also workaround the problem by embedding the font in your style sheet using base64 encoding.

share|improve this answer
    
Yes, it is indeed an embedded font. I thought about pinning the site to a domain, but wanted to know if there's an alternative. –  Vinko Vrsalovic Apr 10 '12 at 9:41
    
@VinkoVrsalovic not so far as I can tell. –  toomanyairmiles Apr 10 '12 at 9:52
1  
That's because IE and FF have chosen to implement an anti-cross-domain DRM mechanism for web fonts (no doubt to appease the type foundries). Another workaround is by embedding the fonts in your stylesheet themselves using base64 encoding. –  Lèse majesté Apr 10 '12 at 10:24
    
@Lèsemajesté I guessed that must be the reason, interesting that base64 gets around it. –  toomanyairmiles Apr 10 '12 at 12:18
    
@VinkoVrsalovic answer updated to reflect Lese's comment which adds an alternative to my work around and clearer reasoning. –  toomanyairmiles Apr 10 '12 at 13:01
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.