Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Blair Rorani
6,658 PointsWhy don't my fonts display on the non-www version of my site in Chrome?
http://everlearning.com.au doesn't show fonts correctly. http://www.everlearning.com.au does. Is there a reason for this? If so, how can I fix it?
I'm testing on Chrome. Safari works fine.
2 Answers
Drew Schott
8,484 PointsI took this from Michael Krebs on stackoverflow.com: " One nice solution is to give each of these 2 domain names the same IP address in each of the A records, and then tell the web server to redirect [mydomain].com to www.[mydomain].com using what is known as a "301 redirect". You can put this in the .htaccess file for [mydomain].com:
Redirect 301 / http://www.[mydomain].com/ "
Drew Schott
8,484 PointsI would recommend removing the "http://www.everlearning.com.au/" from your src's and href's. Just link to the site relative location. Your link is too specific and is not applying some of your files. Unless you are planning on moving your main html files, but keeping the css files and images still on the initial server. But this is not clean coding how you have it.
Drew Schott
8,484 PointsIf you want to play around and also see what's working, you can just remove the 'www.' part of the references, though to save time in create less code it's better to use links like: "link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet"" instead of: "link href="http://www.everlearning.com.au/bootstrap/css/bootstrap.min.css" rel="stylesheet""
Blair Rorani
6,658 PointsThanks. I know how relative vs. absolute links work so I can change this and see what works.
I include the head code (including links to stylesheets) in pages using Craft CMS. This means the pages have different relative paths to /bootstrap/... and therefore need the absolute path every time.
I'll see if I can get relative paths to work though.
Drew Schott
8,484 PointsI also did a little looking around, and it seems like others have had this problem involving going with and without 'www'.
There are a couple suggestions at the bottom of the thread here:
http://stackoverflow.com/questions/12401593/font-face-does-not-work-on-firefox-works-well-on-others
Blair Rorani
6,658 PointsThanks. For some reason my domain is set up with two A records (www and non-www). Obviously I did that but not sure why.
Is it better to have A record for domain.com pointing to IP address and then CNAME for www pointing to domain.com or some other setup? I have MX records and mail.domain.com as well.
Blair Rorani
6,658 PointsBlair Rorani
6,658 Pointssweet. sorry for two questions in one :) seems related though.
Drew Schott
8,484 PointsDrew Schott
8,484 PointsI think Michael's answer is the most applicable to your situation anyway. Glad I was able to help!