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.
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 214MWhy 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.
- Folder openedSomeone visits /uploads/ directly
- Listing shownNo index file, auto-index on
- Files foundCSV, ZIP or SQL files spotted
- 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
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.
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.
Search Google
Search for site:yourdomain.com intitle:"index of" to see whether any listings were already indexed.
Check every subdomain
Repeat on staging, test and old subdomains. They are often forgotten and are less likely to be hardened.
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
doneHow to fix it
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.
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.
IIS: disable Directory Browsing
In IIS Manager select the site, open Directory Browsing and click Disable.
Edit .htaccess on Apache hosts
Add Options -Indexes above the # BEGIN WordPress block, using your host's file manager or SFTP. Keep a copy of the file first.
Nginx hosts
Ask your host to set autoindex off, or edit the server config if you manage it.
Add blank index files as a backup
Upload an empty index.php to folders that must not list. This is a fallback, not a replacement for the server setting.
Nothing to configure
Shopify hosts the storefront and does not expose folder indexes. Check any separate server or subdomain you run, such as a file host or a custom app, using the Custom code steps.
Nothing to configure
Wix does not give you a server config and does not expose folder listings. Check any external hosting you link to for files.
Nothing to configure
Squarespace does not offer folder listings. Check any files hosted elsewhere, such as a separate subdomain on your own server.
# Stop Apache listing folder contents
Options -Indexesserver {
# ...
location / {
autoindex off;
}
}Review what was exposed
List the files that were visible. Look for CSV exports, invoices, .zip, .sql, .bak and log files.
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.
Ask Google to remove cached listings
Use the Removals tool in Google Search Console for any indexed 'Index of' pages.
Rotate secrets if needed
If a config file, key or password file was listed, change those credentials.
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
- 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
- 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.