Netlify fails to load my html, css and js files when my html file is not named "index.html"

I have tried many other option to try solve my issue before coming here to ask.
basically my issue is that I can’t figure out why when I name my .html file any other name than “index.html” or “home.html” it will not work. it will show me that the deployment was successful, but when i preview the page its 404 page not found. But if I name it index.html or home.html it will preview the page and work just fine as if I ran it locally.

I’ve double check that my builds and directory are correct. That my codes are all link properly from my html to css and to js. repo is updated, all works fine. The entire thing crashes only when I change it to a file name like “portfolio.html” and push that ONLY change, then will everything fall apart.

I’ve tried asking chatGPT for solution, read bunch of forums, documentation, and other informations from netlify. But I can’t find anything to help me understand this issue.

for now I’m forced to run it with my .html file named as index.html. the css and js can be named whatever. Just the html naming has issues. I wanna know the issue because I think this will be a bigger issue in the future if I don’t try to figure it out.

Please help me figure out what I’m doing wrong.

Site name: https://adam-yun.netlify.app
Error Message : 404 page not found
Custom Domain : “adam-yun.netlify.app”

Initializing :

11:27:01 AM: build-image version: 8205490ca60064f5c9949f585e9e35b434be95b8 (focal)
11:27:01 AM: buildbot version: eb0b3c03ee1b40888f6883e255e3a141a5a683be
11:27:01 AM: Building without cache
11:27:01 AM: Starting to prepare the repo for build
11:27:02 AM: No cached dependencies found. Cloning fresh repo
11:27:02 AM: git clone --filter=blob:none https://github.com/Adam-Yun/1-personal-portfolio
11:27:03 AM: Preparing Git Reference refs/heads/main
11:27:04 AM: Custom publish path detected. Proceeding with the specified path: ‘portfolio’
11:27:05 AM: Starting to install dependencies
11:27:05 AM: Python version set to 3.8
11:27:05 AM: Attempting Ruby version 2.7.2, read from environment
11:27:05 AM: Using Ruby version 2.7.2
11:27:06 AM: Started restoring cached go cache
11:27:06 AM: Finished restoring cached go cache
11:27:06 AM: go version go1.19.12 linux/amd64
11:27:06 AM: Using PHP version 8.0
11:27:07 AM: v18.17.1 is already installed.
11:27:08 AM: Now using node v18.17.1 (npm v9.6.7)
11:27:08 AM: Enabling Node.js Corepack
11:27:08 AM: Started restoring cached build plugins
11:27:08 AM: Finished restoring cached build plugins
11:27:08 AM: Install dependencies script success
11:27:08 AM: No build steps found, continuing to publishing

Building:

11:27:08 AM: Section completed: building
11:27:08 AM: Finished processing build request in 6.976s

Deploying:

11:27:08 AM: Starting to deploy site from ‘portfolio’
11:27:08 AM: Calculating files to upload
11:27:08 AM: 0 new files to upload
11:27:08 AM: 0 new functions to upload
11:27:08 AM: Section completed: deploying

Cleanup:

11:27:08 AM: Uploading Cache of size 22.1KB
11:27:08 AM: Section completed: cleanup

Post-processing:

11:27:08 AM: Starting post processing
11:27:08 AM: Skipping HTML post processing
11:27:09 AM: Post processing - header rules
11:27:09 AM: Post processing - redirect rules
11:27:09 AM: Post processing done
11:27:10 AM: Section completed: postprocessing
11:27:11 AM: Site is live :sparkles:

Hi Adam,

You’d need to specify the path of the page in that case as part of the URL. If you name a page “portfolio.html”, then you’d go to:
https://adam-yun.netlify.app/portfolio.html to see it.

We only show index.html or home.html “by default” at the bare hostname URL, so you’re not missing anything. This is common for most web services.

Hello @fool ,

I have similar problem. I have multiple HTML files in my repo and there are links in index.html that should redirect to these files. But it doesn’t work, it shows ‘page not found’ every time.

I tried:

<a class="project-links" href="./design-system.html">

and

 <a class="project-links" href="https://uxdesign-portfolio.netlify.app/design-system.html">

None of it works. Can you please advise what I should do to make the website work as intended?

Attached is a screenshot of the path and ‘not found’ message.

my website: https://uxdesign-portfolio.netlify.app

repo: GitHub - lajafar/uxdesign-portfolio: Lala's product and UX design portfolio

thanks in advance!

Hi, @lajafar. There is no such file (no file named design-system.html) in the deploy if you download it.

Also, because I work at Netlify, I can see the URL for the repo for this site. The repo is public and the repo itself doesn’t contain this file. The URL is a 404 because you don’t have the file in the repo and, if it isn’t in the repo, that means Netlify has no way to deploy it (as we can only get it from the repo).

Can you commit that file to the upstream repo and confirm if it works once that is done?

Hey @luke . It doesn’t seem like Netlify deploys any of my latest changes. GitHub - lajafar/uxdesign-portfolio: Lala's product and UX design portfolio has all of the necessary htmls. However, based on the logs, I cannot see any changes. Thanks.

UPD: I couldn’t find a solution on Netlify, so I deployed everything on GitHub Pages. It works as intended. Hope this issue will be fixed in the future.

Hi, @lajafar. This was not an issue with Netlify. If you make the repo public and send us a link to the GitHub Pages site, we can debug further.

The repo was public before but now it is private. However, before you made it private, I used the GitHub search functionality to search the entire repo. I can say with 100% certainty there were definitely no files in the repo anywhere (even historically) named design-system.html.

Hey @luke !
I got everything working on Netlify after doing the following:

  1. Removed the build command and publish directory from the site configuration
  2. Redeployed.

Case resolved.

2 Likes

Glad to hear it. Thanks for writing back in and sharing this.

1 Like

Hello, I have a folder with two html, the main one called index.html, the second download.html, I also have two css and one js, all saved in the same folder and when I upload it manually by dragging the folder and opening my address it tells me Page Not Found https://nicestore.netlify.app I have already read several forums and I cannot find a solution to the problem, if someone could help me

@nicoo I’m not seeing a site connected to your account named nicestore. Could this be under a different name?