Colet Colet - 12 days ago 9
CSS Question

Github pages, bootstrap css remotely: Failed to load resource: the server responded with a status of 404 (Not Found)

I have my customized bootstrap website which I push on github pages. Locally it works very fine, no problem at all, but when is online the style is messy and these messages appear on the console:

Failed to load resource: the server responded with a status of 404 (Not Found) https://nickname.github.io/repo/vendor/font-awesome/css/font-awesome.min.css Failed to load resource: the server responded with a status of 404 (Not Found)


in my code, css is declared as follow:

<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">


why locally works and not remotely?

Answer

It looks like you are using Jekyll for your GitHub page. As for the Jekyll 3.3 from Nov 2016, the vender folder is ignored.

Jekyll now ignores the vendor and node_modules directories by default.

You can either rename the vender folder to some name like libs and refer to the new path, or follow Jekyll's suggestion

If you need those directories included in your site, set exclude: [] in your site's configuration file.

Hope it helps:)