Search code examples
htmlcssgithub-pages

how can i fix failing to load resource status 404 github pages


I have deployed my project on Github and it gives this 👇

img_error

errors on the console and how may i fix it?

and link to the git is: https://blessja.github.io/Bottelary/

github repo: https://github.com/blessja/Bottelary


Solution

  • Change the incorrect file URLs in the index.html.

    For example, you have written <link rel="stylesheet" href="/css/main.css"> which targets to https://blessja.github.io/css/main.css, which gives a error 404.
    Instead type <link rel="stylesheet" href="./css/main.css"> or <link rel="stylesheet" href="css/main.css"> which will get you to the right file, i.e. https://blessja.github.io/Bottelary/css/main.css

    And try changing all the incorrect file paths mentioned in the index.html file.