SEO check

Directory Browsing Check: How to Test and Disable It

Learn what directory browsing is, how our report tests it, and how to turn it off on Apache, Nginx, IIS and WordPress.

Free to use 9 min read Updated Oct 2026

Directory browsing check: the quick answer

Quick answer: Directory browsing, also called directory listing or directory indexing, is a server feature that builds a clickable list of files whenever a folder has no index file. Our report requests your page once and fails it if the answer is a list titled Index of /.

  • Pass: the address we tested returned a normal page or an error such as 403 or 404, not an auto generated file list.
  • Fail: the answer contained a list titled Index of /, or the site did not answer within 3 seconds.
  • Fix: Options -Indexes on Apache, autoindex off on Nginx, directoryBrowse enabled false on IIS.

Check my site free

An open listing can hand out backups, logs and uploads that nobody ever linked to, to anyone who asks.

What is directory browsing?

When a visitor requests a folder such as /uploads/, the server first looks for a default index file. On Apache that name comes from the DirectoryIndex directive, usually index.html or index.php. If none exists and indexing is allowed, the server writes a page of its own that lists every file and subfolder.

You will meet the feature as directory listing, directory indexing, open directory, autoindex or the Index of page. The modules behind it are mod_autoindex on Apache HTTP Server, ngx_http_autoindex_module on Nginx and the directoryBrowse element on Microsoft IIS.

Defaults differ, so test instead of assuming. Nginx and IIS ship with listing off, and Apache's core Options default is only FollowSymlinks, yet many hosting images and sample configs add Indexes.

It is a setting, not a bug, and public download mirrors use it on purpose. To enable it deliberately, flip the same switch (Options +Indexes, autoindex on or directoryBrowse enabled="true") for one download folder only. Directory traversal is a different attack that escapes the web root with ../ paths.

Why directory browsing is a security risk

A listing is harmless on its own. What hurts is the content. A forgotten file used to be protected only by the fact that nobody knew its name, and a listing prints that name for every visitor. A backup in the web root is a small mistake until a listing publishes it.

A fictional example shows what a careless folder gives away.

Text
Index of /backup

db_dump_march.sql       2026-03-02 09:14   48M
site_full.zip           2026-03-02 09:20   212M
wp-config.php.bak       2026-02-11 17:45   3K
error_log               2026-03-10 06:01   9M

In the sample above the SQL dump holds customer rows, the .bak config copy may carry database credentials, and the error log shows server paths and software versions. An attacker can read those versions and pick the next target without a single probe, which is plain reconnaissance.

The weakness is catalogued as CWE-548 weakness entry, Exposure of Information Through Directory Listing, and its listed mitigation is to turn automatic listings off. MITRE maps it to the OWASP Top 10 under Security Misconfiguration in 2013 and 2017 and Broken Access Control in 2021. It is information disclosure, not a ranking factor, but a listing is ordinary linked HTML that crawlers can follow into files you never meant to publish. If an exposed file ever triggers a Google warning, the Safe Browsing check is the next stop.

How SEO Site Checker tests directory browsing

The test is deliberately small. Our report sends one plain GET request to the address you submitted, adds a trailing slash if it is missing, follows redirects and gives up when the server stays silent for 3 seconds. That limit covers connecting and each wait for data, not the whole exchange.

The exact rule: the response text is searched for the phrase Index of /, which Apache and Nginx print in the title and heading of an auto generated listing. If it is there, the item fails. Status codes are not inspected.

What the test does

The request goes to the page you entered, usually your home page. No folder names are guessed.

What pass and fail mean

Only the text matters, so a 403, a 404 and even a 500 all count as a pass. The table shows the five cases.

What the server answeredReport resultWhat it tells you
A normal pagePassThe tested address has an index file.
403 Forbidden or 404PassListing is refused or the path is missing.
A list titled Index of /Fail, with the How to Fix buttonApache or Nginx is printing a listing.
No answer within 3 secondsFailNothing proven about listing, only a slow site.
Refused connection, DNS or TLS errorFailThe request never completed.

A pass means the tested address showed no auto generated list. It does not prove /uploads/ or /backup/ are closed, because those were never requested.

What the test cannot see

Other servers word their lists differently. Python's http.server titles its page Directory listing for /, and IIS puts the host name and path in the title (we did not test IIS in the lab), so those pass unnoticed. A 500 from a broken .htaccess also passes, and a page that merely contains the words Index of / would fail by mistake. In our lab we ran the same logic against Apache 2.4.58, Nginx 1.24.0 and Python http.server: the Apache and Nginx lists failed, closed folders returned 403 and passed, and the Python list passed.

Run the free SEO report

How to check if directory browsing is enabled

  1. Run the report. Scan your home page and read the line labeled Directory Browsering Check, which is how the report currently spells it.
  2. Open a real folder. In a private browser window, visit a folder that has no index file, for example https://example.com/wp-content/uploads/ on WordPress. A page titled Index of /wp-content/uploads means it is open, while a 403, a 404 or a normal page means it is closed.
  3. Use curl. From a terminal, request the same folder, follow redirects and search the output for the marker.
Text
curl -sL https://example.com/wp-content/uploads/ | grep -i "Index of"

The -L flag follows redirects like our report does. Without it, a redirecting folder returns an empty body, which looks like a pass. If grep prints a line, the folder is listing. Repeat it for each top level folder, subdomain and download host, since the setting can differ.

How to disable directory browsing on Apache, Nginx and IIS

First learn which server you run: the Hosting Checker shows it. The same config files often hold the leak covered by the Server Signature check, so fix both together.

Apache and .htaccess

Add Options -Indexes to the relevant Directory block in httpd.conf or the virtual host, then reload with apachectl graceful. The directive is documented in the Apache Options directive reference.

Text
<Directory "/var/www/example.com/public">
    Options -Indexes
</Directory>

On shared hosting without server access, put the same line in .htaccess instead.

Two traps showed up in our lab: AllowOverride None silently ignores the .htaccess line, and AllowOverride FileInfo alone makes the site return a 500 error. Mixing options that carry a plus or minus sign with plain ones is invalid syntax and Apache rejects it.

Nginx

The autoindex directive defaults to off, so look for autoindex on in nginx.conf or a site file, in the http, server or location block, and remove it or change it. Check the file with nginx -t, then reload. The behavior is described on the Nginx autoindex module page.

Text
location /downloads/ {
    autoindex off;
}

IIS

Set directoryBrowse to disabled in web.config under system.webServer, or open the Directory Browsing feature in IIS Manager and choose Disable. The default is already false, so a listing means someone enabled it.

XML
<configuration>
  <system.webServer>
    <directoryBrowse enabled="false" />
  </system.webServer>
</configuration>

cPanel, LiteSpeed and WordPress

In cPanel, the Indexes tool (Index Manager in some themes) lets you set a folder to No Indexing. LiteSpeed reads the same .htaccess line as Apache, and on WordPress you should place Options -Indexes in the root .htaccess outside the BEGIN WordPress and END WordPress markers, because core rewrites everything between them.

Success looks like a 403 Forbidden on the folder, which is correct, not a fault.

Directory browsing mistakes that keep the check failing

Most stubborn cases come from an edit that never took effect. Once it is fixed, re-run any scanner that flagged the folder.

Diagnosis shortcut: after an .htaccess edit, a 500 error means AllowOverride does not include Options, while an unchanged listing means AllowOverride is None or you are editing the wrong layer. Either way, move the line into the virtual host config.

  • Wrong layer. A proxy, CDN origin or second server may serve the folder with its own settings. Request it on the origin and through the CDN, then compare.
  • A hiding attempt. A Disallow rule only asks crawlers to stay away and publishes the folder name, so read the robots.txt guide first.
  • A local override. A subfolder with its own .htaccess can set Options +Indexes again,
  • Stale results. Skipping the reload, or testing a cached page, makes a correct fix look broken.

Best practices for keeping folder listings closed

  • Default to off. Keep indexing disabled server wide and enable it only for a deliberate download folder.
  • Clean the web root. Never leave backups, SQL dumps or env files where the server can serve them. Migrations are the usual source, because old backups ride along into the new web root.
  • Add layers. A blank index.html is a cheap second barrier.
  • Re-test often. Check again after every migration, host change or plugin install.
  • Assume exposure. If a backup, dump or env file was ever listed, delete it and rotate passwords and keys. If the site was abused, follow the blacklist cleanup guide.

How to Fix

The short version, the same steps you see when you click How to Fix in your report.

Why this fails: the address we tested answered with an auto generated file list titled Index of /, or it did not answer within 3 seconds. The web server, not your site content, builds that list whenever a folder has no index file.

How to fix it:

  1. Find out which server you run. Check the Server line in your browser's network panel or your hosting control panel, then use the matching step.
  2. On Apache or LiteSpeed, open httpd.conf, your virtual host file or the site's .htaccess, add the first line below, then reload with apachectl graceful. A .htaccess edit needs AllowOverride Options, otherwise the line is ignored or the site returns a 500 error.
  3. On Nginx, remove autoindex on from the server or location block, or set the second line below, then run nginx -t and reload.
  4. On IIS, add the third line in web.config under system.webServer, or choose Disable in IIS Manager.

Apache and LiteSpeed:

Text
Options -Indexes

Nginx:

Text
autoindex off;

IIS:

XML
<directoryBrowse enabled="false" />
  • cPanel: open the Indexes tool and set the folder to No Indexing.
  • WordPress on Apache: put Options -Indexes in the root .htaccess, outside the BEGIN WordPress and END WordPress block.

If a folder test already shows a normal page or a 403, the red mark came from a slow or refused answer, or from a page that contains the words Index of / in its own text, so confirm the site loads and check its source first.

Re-test: open a folder URL without an index file, such as /uploads/, in a private window and expect a 403 or 404 instead of a list. You can also run curl -sL https://example.com/uploads/ | grep "Index of", which should print nothing. Then run our free report again. It only tests the address you submit, so check the folders yourself too. Details are in the Apache Options directive reference.

Re-test my website

Frequently Asked Questions

What is directory browsing?
It is a web server feature that shows visitors a clickable index of a folder's files when no default page such as index.html exists. You will also see it called directory listing or directory indexing, and you change it in the server settings, not in your content or your CMS.
Is directory browsing a security vulnerability?
It is a misconfiguration that leaks information, catalogued as CWE-548. It becomes a directory browsing vulnerability when the folder holds backups, logs or private uploads, and it is harmless for a deliberate public download folder. The safe default is off. After fixing it, rescan and treat any file that was listed as already exposed.
How do I check if directory browsing is enabled on my website?
Open a folder URL that has no index file in a private browser window and look for a page titled Index of. Or run our free SEO report, which tests the address you submit. A 403 or 404 answer means the folder is closed.
How do I disable directory browsing in Apache?
Add Options -Indexes to the Directory block in httpd.conf or the virtual host, or to .htaccess when AllowOverride permits Options, then reload Apache. With AllowOverride None the .htaccess line is ignored and the list stays, so check that setting first if nothing changes.
How do I turn off directory listing in Nginx?
Nginx leaves autoindex off unless something turned it on, so search your config for autoindex on in the http, server or location block and delete it or set it to off. Run nginx -t to check the syntax, then reload. A closed folder answers 403 Forbidden, which is correct.
How do I disable directory browsing in IIS?
Set directoryBrowse enabled to false in web.config under system.webServer, or open the Directory Browsing feature in IIS Manager and choose Disable. The IIS default is already false, so a visible listing normally means someone switched it on.
How do I disable directory browsing in WordPress?
WordPress does not control this, the web server does. On Apache or LiteSpeed, add Options -Indexes to the root .htaccess outside the WordPress block. On Nginx, remove autoindex on. A security plugin usually writes the same line or adds blank index files for you.
Does disabling directory browsing affect my site's SEO?
No. Visitors and search engines still load your pages normally because pages have index files. Only the auto generated file list disappears, so crawlers stop finding stray files through it. Treat it as a security and trust fix, not a ranking factor.

See how your site scores right now

Paste your address into the free report, then use the How to Fix button on anything that needs work.

Free to use. Results in under a minute for most sites.