Privacy

A website shows “Index of /…”: check the public folder and initial page

A directory listing instead of a homepage needs a mapping and initial-resource check. Preserve the correct site and separate hiding a listing from protecting files.

Made by Pagember · Editorial policy

Editorial guidancePublished Updated Sources

The short answer

An Index of page usually means the request reached the wrong public folder, lacks the expected initial page, or hits a server that generates listings, not that the application needs reinstalling. Record the exact hostname and path, ask the hosting operator which site and folder answered, confirm the intended initial resource, and check listing and direct-file access separately without blindly changing permissions.

On this page9 sections

A visitor expects a homepage but sees a list of files headed Index of. That is not proof the application needs reinstalling. The request may be mapped to the wrong public folder, lack the expected initial resource, or reach a server configured to generate directory listings.

A conceptual open folder exposes a public file list beside a separate index.html page and an independent access-control lock, distinguishing a listing from the intended page and file permissions.

Imagine an association moving a small website to an account that also hosts another project. Its owner must identify the responding site before changing anything.

Identify the exact public request

Record the hostname, path and whether the address ends in a slash. Note whether the unexpected listing appears at the homepage, a subfolder or only after a redirect. A screenshot of file names without its request context can lead an operator to the wrong site.

If the listing appears to expose sensitive material, stop exploring its files and notify the authorized owner through a private support route. Do not download archives or publish the full listing to prove the point. A small safe description is enough to begin containment and diagnosis.

First ask whether the listing is intended. A deliberately public download catalog is a different product from a homepage. The repair should follow the owner’s publication decision rather than remove an intentional interface merely because it resembles an error.

Confirm the host and mapped public folder

Ask the hosting operator to confirm the site mapping for the exact hostname and path. On a shared account, a familiar folder name is not sufficient evidence that it belongs to the intended domain. Preserve unrelated sites and their existing configuration.

The secure file-transfer guide helps establish which folder and account a transfer targets. Here, compare the deployment’s expected public content with the folder actually served. A successful file transfer does not by itself prove the server maps visitors there.

For the association, keep the previous mapping and deployment manifest available before a scoped correction. Do not move or merge folders merely because they contain similar filenames. The operator should be able to explain which host and route the change affects.

Check the intended initial resource

Apache’s mod_dir documentation describes directory handling and configured initial resources. The operator needs to compare the resource expected by the deployment with the active configuration, rather than assume every host searches for the same filename in the same order.

Verify whether the expected entry file was deployed in the correct public location and is part of the supported application package. A nested archive extraction can leave the entry point one folder away from the actual public root. Treat that as a possibility to confirm, not a diagnosis inferred from the listing alone.

A stale placeholder page can also be served instead of the intended application. Ask the operator to reconcile the documented entry resource and server precedence. Avoid creating a new empty index file simply to hide the symptom: it may conceal the deployment problem without restoring the website.

Understand generated listing separately

Apache’s autoindex module documents generated directory indexes. The nginx autoindex module describes its own listing behavior and a default-off setting. These references describe server mechanisms; they do not establish which server or configuration answered this particular request.

Have the responsible operator confirm the actual mechanism before editing configuration. A page resembling a listing could also be application-generated. Disabling an unrelated module or changing every folder’s settings is not a supported diagnosis for one unexpected route.

FindingFocused investigationDo not assume
Homepage maps to an unexpected folderConfirm the exact host-to-folder configurationEvery similar folder belongs to this site
Expected entry resource is absentCompare the deployment package and target pathAn empty replacement file repairs the application
Server generates a directory listingReview listing policy in the relevant scopeTurning listing off makes direct files private
Unrelated site appears after a changeRestore the intended mapping through its operatorThe other site should be overwritten or merged

Checks and fixes you can run yourself

  1. Find the document root. In cPanel, open Domains and read the document root listed for the affected domain; it is often public_html for the main domain and a separate folder for add-on domains.
  2. Look for the entry file. Open that folder in File Manager or over SFTP. A WordPress site needs index.php there; a static site usually needs index.html. If the files sit one level down, for example in public_html/site/ after unzipping, move them up or point the domain at that folder.
  3. Turn off listings on Apache. Add this line to the .htaccess file in the document root, keeping a copy of the original file:
Options -Indexes

If the site returns a 500 error after that change, the host does not allow the directive in .htaccess; remove the line and ask support to disable indexes for you. Where the entry file has a different name, DirectoryIndex index.php index.html sets which files Apache looks for.

On nginx, the equivalent settings live in the server block, which on most hosting plans only the operator can edit:

index index.php index.html;
autoindex off;

After any change, reload the original address in a private window and check one subfolder, such as /wp-content/uploads/, which should no longer list its files.

Separate hidden listings from private files

Generated listing and direct file access are different observations. A folder can stop advertising its contents while a known public URL still retrieves a file. Hiding the list is therefore not sufficient evidence that documents, backups or configuration exports are protected.

Ask the owner to identify what should genuinely be public and what belongs outside public delivery or behind appropriate access control. Use harmless approved fixtures to verify the intended boundary. Do not test a real confidential backup merely because its filename was once visible.

The access-refusal guide helps distinguish refusal and response ownership. The intended result for a private file needs its own verification; a new homepage or a missing folder index cannot substitute for that check.

Repair the confirmed scope without broad permissions changes

A supported correction may restore the documented entry file, correct the mapped deployment path or change a listing policy for the intended location. Keep a record of the previous state and the operator’s recovery plan. Do not apply permissive permissions across the account to remove a visible error.

If the correct application begins loading but presents the wrong homepage content, investigate its own content setting separately. The WordPress homepage and posts-page guide covers that application-level choice. Server entry resolution and the page selected inside WordPress are not the same decision.

Give the operator a compact handoff naming the affected public request, the intended site and the expected entry resource from the deployment record. Mark any unconfirmed mapping explicitly. This helps prevent a later maintainer from applying the same change to every directory on a shared hosting account.

Verify the public entry and the access boundary

After the operator’s scoped repair, reopen the original public address and relevant subpath. Confirm the intended site, page and ordinary navigation appear. Check the agreed harmless private-file fixture remains inaccessible through its direct URL, and confirm unrelated hosted sites are unchanged.

Keep the verified mapping, initial-resource rule and listing policy in the handover without publishing private server paths or file names. Finish with a functioning intended entry page and a separately checked access boundary, rather than simply a screen that no longer says Index of.