GET 404 error for style.css not found GET 404 error for style.css not found codeigniter codeigniter

GET 404 error for style.css not found


404 is a 'not found' error. Meaning, the browser cannot find your style.css with the path it was given. If it is working on some templates and not others, it is because you may have a different file structure for some templates, a sub-folder for example.

A quick fix would be to make your style.css load from an absolute path

https://yourdomain.com/public/css/style.css

A better solution would be to traverse the directory to the css folder and then reference your style.css.

Learn about relative paths and find a solution that works for all templates. The answer is likely to be something like:

/public/css/style.css

However, it could be something like:

../public/css/style.css

Where goes back to one more previous directory. More about absolute vs. relative paths http://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/


You can try replacing the contents of original 404 Page Not Found error page with your custom error page. Make sure you doesn't change the name of that file or its location.

Hope it helps


Change <base href="/"> to <base href="./"> from index.html