CSS not rendering after deploying my website


I’m new to web dev. I’m currently having some trouble deploying my first website.
Here is my website: https://cookcommmm.netlify.app/
Here is my github repo: GitHub - Sopheaktra-Phol/food-blog

Only HTML is showing and my CSS files don’t work after I deploy that repo. If you have any suggestion please help me. Thank you

@nexus You need to fix your Build settings.

From what I can see, you’re deploying the root of the repository, so all the files are in a folder of:

For example:

But you have a _redirects in the root that says:

Which is why most requests are serving the content of /food-website-main/index.html

You probably want to:

  • Get rid of the _redirects file in the root of the repository
  • Set your Base directory in your Build settings to food-website-main
  • Remove the redirect in the food-website-main/netlify.toml file as it will cause you issues

OMG it finally worked! thank you so much.

I do have one more question. Since I have 2 index.html files right now but I want the website to load the /login-page/index.html first. how can I tell the deployment to do that?

What exactly do you mean by “first”?

Under what circumstances would someone see /login-page/index.html and when would they see /index.html?

I want /login-page/index.html to be the first page to load so people can login before they start using the website then after loging in the index.html (main page) will load

That’s what I thought you might be trying to do.

You wouldn’t achieve that with a normal Netlify redirect since they’re indiscriminate.
A normal redirect would always redirect everyone, regardless of it they were logged in etc.

You could look in to following:

thank you so much i will try