muldev's avatar
Level 16

404 error on css bootstrap

I have a new Laravel installation and I'm using the sass bootstrap with a very simple entry.

When I go to mysite root http://mysite it works with no errors. However anything more than that like http://mysite/test show a 404 error. The nginx error.log is blank, however access.log has this error: For some reason, not sure if it's elixir or Laravel but the folder is omitting the full path as seen below :

127.0.0.1 - - [15/Feb/2016:01:53:05 +1100] "GET /fonts/bootstrap/glyphicons-halflings-regular.ttf HTTP/1.1" 404 151 "http://mysite/css/main.css"     "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0"

my main.scss file located in ../mysite/resources/assets/sass/main.scss lloks like this:

@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
$primaryColor: red;
body {
  padding-top: 70px;
  color: $primaryColor;
}

I am using Gulp and my gulpfile.js looks like this:

var elixir = require('laravel-elixir');

elixir(function(mix) {
    mix.sass('main.scss');

});

Nothing fancy yet :)

any ideas on what I can do and why this is happening ?

0 likes
2 replies
muldev's avatar
muldev
OP
Best Answer
Level 16

Solved. It was an nginx problem in my configuration file. vim /etc/nginx/sites-available/[your site name] I changed:

    try_files $uri $uri/ =404;

WITH

    try_files $uri $uri/ /index.php$is_args$args;

and it solved the 404 problem.

1 like
Barbarasko's avatar

Bootstrap 3 comes with a boostrap.css.map file (and its equivalent minified version). If you add this to your assets/css folder it will load with no error. Alternatively you can remove the following line from the bootstrap.css file. /*# sourceMappingURL=bootstrap.css.map */


http://www.thecheesyanimation.com/3D-Walkthrough.html

Please or to participate in this conversation.