Home » Website Errors » Missing Index File and 'Index of /' Pages: Set Up the Homepage Correctly

Missing Index File and 'Index of /' Pages: Set Up the Homepage Correctly

Published 2026-10-03 | Website Errors

Missing Index File and 'Index of /' Pages: Set Up the Homepage Correctly banner

When someone visits https://example.com/, the server does not know which file to send. It looks inside the site's root folder for a file with a special name, usually index.html or index.php. If it finds none, one of three things happens, depending on configuration:

  • It shows a plain list of every file in the folder ("Index of /").
  • It refuses with 403 Forbidden.
  • It shows a default welcome page left by the host.

All three mean the same thing: no recognised homepage file in the place the server is looking.

Step 1: find the document root

The document root is the folder the domain points to. Typical locations:

Host type Usual document root
cPanel, main domain public_html/
cPanel, addon domain public_html/addon-domain.com/ or a folder you chose
Plesk httpdocs/
Apache on Ubuntu /var/www/html/
nginx whatever root says in the site's config

Open the control panel's domain settings to confirm. A very common mistake is uploading the site into public_html/mysite/ so the real files sit one level too deep.

Step 2: check the index file name

Inside the document root, look for the homepage file:

  • It should be named exactly index.html or index.php (all lowercase).
  • Watch for hidden extensions: Windows can save index.html.txt while showing index.html.
  • If a host placeholder such as default.html or an old index.html is present next to your index.php, the server may pick the placeholder first. Remove or rename it.

The order the server checks is set by DirectoryIndex on Apache:

DirectoryIndex index.php index.html

and by index on nginx:

index index.php index.html;

Step 3: check permissions

The server must be able to open the folder and read the file. Folders need 755 and files 644. If the index file is set to 600 or owned by another user, the server sees it but cannot read it, and you get a 403 instead of your page.

Step 4: turn off directory listings

Even with a homepage in place, other folders without an index file (such as /uploads/ or /backup/) may list their contents. Switch listings off.

Apache, in .htaccess at the root:

Options -Indexes

nginx, in the server or location block:

autoindex off;

After this, folders without an index file return 403 instead of a list, which is what you want.

Step 5: test

Visit the bare domain, the www version, and a subfolder such as /images/. The first two should show your homepage. The subfolder should return 403, not a file listing.

Common mistakes

  • Uploading the whole project folder instead of its contents.
  • Leaving the host's placeholder page in place, so it wins over your file.
  • Naming the file Index.html or home.html and expecting the server to find it.
  • Turning on directory listing to debug and forgetting to turn it off.

Frequently Asked Questions

Is it dangerous to show an 'Index of /' listing?

It can be. A listing shows every file in the folder, including backups, config copies and uploads you did not mean to publish. Turn directory listing off even after adding an index file.

Which file name does the server look for?

Usually index.html, index.htm or index.php, in an order set by the server configuration. Names are case-sensitive on Linux, so Index.html is not the same file.

My files are uploaded but I still see the host's welcome page. Why?

The host's placeholder index file is still in the document root and is found first, or you uploaded your site into a subfolder instead of the document root.

Found a mistake or still stuck? Contact us. See how we write and check these guides in our editorial policy, or read about DocumentGuy.

More in Website Errors