Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Directory listing enabled: how to find and turn it off

OPS-162Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

When you open a web address that points to a folder, the server looks for a default file such as index.html or index.php. If it finds none and directory listing (also called directory browsing or auto-indexing) is on, it builds a page titled 'Index of /folder' that lists every file inside.

It is a server setting, not a bug in your site code. It often appears on upload folders, plugin folders, old test folders and backup locations.

What an exposed folder looks liketext
Index of /wp-content/uploads/2024

Name                 Last modified      Size
../
invoice-1042.pdf     2024-05-02 10:14   88K
export-leads.csv     2024-05-02 10:20   1.2M
old-site-backup.zip  2024-04-11 09:01   214M

Why it costs you leads or sales

Directory listing does not break your funnel on its own. The harm is indirect. It hands visitors and automated scanners a map of your site, so lead exports, invoices, backups, config files or draft pages can be found and downloaded. A leaked customer list or a defaced site can lead to lost trust, data protection trouble and browser or ad platform warnings.

How an exposed folder leads to a leak
  1. Folder openedSomeone visits /uploads/ directly
  2. Listing shownNo index file, auto-index on
  3. Files foundCSV, ZIP or SQL files spotted
  4. Data leakedLeads or backups downloaded

The break is the server showing the file list. Later steps follow from it.

How to check if your site has it

Check for open directory listing
  1. Try common folders in a browser

    Open these paths on your domain: /wp-content/uploads/, /wp-content/plugins/, /images/, /assets/, /uploads/, /backup/. An 'Index of' page, or a plain list of files, means listing is on.

  2. Test with curl

    Run curl -s https://example.com/uploads/ | head and look for 'Index of' in the output. A 403 or 404 status is the safe result.

  3. Search Google

    Search for site:yourdomain.com intitle:"index of" to see whether any listings were already indexed.

  4. Check every subdomain

    Repeat on staging, test and old subdomains. They are often forgotten and are less likely to be hardened.

Quick check from a terminalbash
for p in uploads wp-content/uploads wp-content/plugins images assets backup; do
  echo -n "/$p/ -> "
  curl -s -o /tmp/out -w "%{http_code} " https://example.com/$p/
  grep -q "Index of" /tmp/out && echo LISTING-ON || echo ok
done

How to fix it

Turn off directory listing by platform
  1. Apache: add Options -Indexes

    In the site's root .htaccess file (or the virtual host config) add the line Options -Indexes, then reload Apache if you edited the main config. AllowOverride must permit Options for .htaccess to work.

  2. Nginx: set autoindex off

    In the server or location block, set autoindex off; (this is the default) and remove any autoindex on; lines. Test with nginx -t and reload.

  3. IIS: disable Directory Browsing

    In IIS Manager select the site, open Directory Browsing and click Disable.

Apache .htaccesshtaccess
# Stop Apache listing folder contents
Options -Indexes
Nginx server blocknginx
server {
    # ...
    location / {
        autoindex off;
    }
}
After turning listing off
  1. Review what was exposed

    List the files that were visible. Look for CSV exports, invoices, .zip, .sql, .bak and log files.

  2. Remove or move sensitive files

    Delete them or move them outside the web root. If they held personal data, treat it as possibly exposed and follow your breach process.

  3. Ask Google to remove cached listings

    Use the Removals tool in Google Search Console for any indexed 'Index of' pages.

  4. Rotate secrets if needed

    If a config file, key or password file was listed, change those credentials.

Folder request before and after

Listing on

  • /uploads/ returns 200 with 'Index of'
  • Every filename is visible
  • Scanners can pick targets

Listing off

  • /uploads/ returns 403 or 404
  • Filenames are not revealed
  • Sensitive files removed as well

How to confirm it's fixed

Confirmation checklist
  • Each folder you tested earlier now returns 403 or 404, not an 'Index of' page
  • The curl loop shows 'ok' for every path
  • Subdomains and staging sites were tested too
  • The Google search for intitle:"index of" on your domain shows nothing new
  • Sensitive files found earlier are deleted or moved

How to prevent it happening again

Prevention habits
  • Keep Options -Indexes or autoindex off in your server templates for new sites
  • Do not store exports, backups or logs inside the web root
  • Check after server migrations, host changes and PHP or Nginx upgrades, which can reset config
  • Harden staging and test subdomains the same way as production
  • Re-run the folder checks every quarter or after a major site change

How FunnelGuard handles this

FunnelGuard does not check for directory listing today. It is a possible future check. FunnelGuard runs your real customer journeys, such as lead forms, checkouts and booking buttons, and checks the steps, the tracking hits and whether test leads arrive. It does not browse your folders.

To watch for this yourself, put the curl loop above in a monthly reminder or a scheduled script, and repeat the Google intitle:"index of" search. A security scanner or your host's malware scan can also flag open indexes. The free FunnelGuard audit is read-only and is not a security scan.

Questions people ask

What is directory listing and why is it bad?

Directory listing is a server feature that shows a list of all files in a folder when no index page exists. It is a risk because it reveals filenames such as backups, exports and config files, making them easy to find and download.

How do I disable directory listing in Apache?

Add the line Options -Indexes to your .htaccess file or virtual host config. Visitors then get a 403 error instead of a file list. The .htaccess route requires AllowOverride to permit Options.

How do I turn off directory listing in Nginx?

Set autoindex off; in the relevant server or location block and remove any autoindex on; lines. Run nginx -t to test the config, then reload Nginx.

How do I check if directory listing is enabled on my website?

Open folders like /uploads/ or /wp-content/plugins/ in a browser, or run curl on them. If the page is titled 'Index of' and lists files, listing is on. A 403 or 404 is the safe result.

Is directory listing a security vulnerability?

It is an information disclosure weakness. It does not let attackers in by itself, but it shows them what is on your server and can expose sensitive files that should never have been public.

Why is my WordPress uploads folder showing a list of files?

Your server has auto-indexing on and the folder has no index file. Add Options -Indexes to .htaccess on Apache, or set autoindex off on Nginx. Also remove any private files stored in uploads.

Does FunnelGuard detect directory listing?

No. FunnelGuard does not check for directory listing yet, though it is a possible future check. It monitors your funnel journeys, tracking hits and test lead delivery instead.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: site safety (Stage 26, daily): directory listing of /wp-content/uploads/ (verified sites).

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.