ihavemorealts
ihavemorealts

Reputation: 34

HTML Imported font working on local, not on web server

I just finished creating the main page of my website, and I've just realized the font I imported from google isn't working. It works and shows up fine when I view the website locally, but as soon as I upload it to my web server it doesn't show. I don't know if it matters, but I'm running Ubuntu 14.04 with apache2. Here is the html import:

  <link rel="stylesheet" href="css/master.css">
  <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet">

Here's the css I have:

@import 'https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300';

body
{
    background-color: #dfdfdf !important;
    font-family: 'Open Sans Condensed', sans-serif !important;
}

It works fine on local, but when I upload to a web server it stops working.

Upvotes: 1

Views: 148

Answers (2)

Tyler Roper
Tyler Roper

Reputation: 21672

Are you sure the issue isn't just a caching problem? The fact that you said you didn't even see your updates in the CSS file when you checked the resources leads me to beleve that it just wasnt getting the newest version

In the future when making any changes to an external style sheet, it's good practice to force a cache refresh by appending a number to the end of your reference URLs, like so: <link rel="stylesheet" href="css/master.css?1">, and incrementing the number each time.

The ?1 tricks the browser into believing that its a new link, so it re-fetches the stylesheet and gets the latest version.

Upvotes: 1

ihavemorealts
ihavemorealts

Reputation: 34

Edit* I tried putting all the files on a different domain I own, and it worked perfectly. I checked cloudflare and compared the two domains. They both pointed to my server box, however the one with the issues had an extra a record with * pointing to another ip. I removed it, and it works fine. I don't know what that extra a record was, or why it conflicted with my stuff.

Upvotes: 1

Related Questions