> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enabling and disabling directory index listings via .htaccess

> Enable or disable directory index listings with .htaccess to manage web server directory displays without an index page.

This article describes how to enable and disable directory index listings using an *.htaccess* file. You can configure the web server to display file listings for directories that do not have a directory index page.

<Note>
  Alternatively, you can configure directory index listings in cPanel. For more information, please see [this article](/docs/index-manager).
</Note>

## Using directory index listings

By default on hosting.com servers, when visitors go to a URL that requests a directory, such as *[http://example.com/products](http://example.com/products)*, the web server looks for the [default directory index page](/docs/default-directory-index-page). If the directory index page does not exist, the web server displays a "403 Forbidden" error message. This is because directory index listings are disabled by default for security reasons.

### Enable directory index listings

In some cases, however, you may want to enable index listings for a directory. To do this, use a text editor to add the following line to the *.htaccess* file:

```
Options +Indexes
```

This directive enables standard indexing, where the index listing shows only the filenames. You can also enable "fancy" indexing, where the index listing shows filenames, their filesizes, and when they were last modified. To do this, add the following line to the *.htaccess* file:

```
IndexOptions +FancyIndexing
```

<Note>
  You can enable directory index listings for your entire web site, though for security reasons this is not recommended. If you are sure you want to do this, add the **Options +Indexes** directive to the *.htaccess* file in the public *html directory. All subdirectories beneath it that do not have their own*.htaccess\_ file will inherit the setting.
</Note>

### Disable directory index listings

Directory index listings are disabled by default, so you only need to explicitly disable them if they were previously enabled in an *.htaccess* file. To do this, use a text editor to modify the **Options** line in the *.htaccess* file as follows:

```
Options -Indexes
```

Similarly, if you have enabled fancy indexing and want to disable it, yet leave standard indexing enabled, use a text editor to modify the **IndexOptions** line in the *.htaccess* file as follows:

```
IndexOptions -FancyIndexing
```

## More information

For more information about configuring directory index listings, please visit [http://wiki.apache.org/httpd/DirectoryListings](http://wiki.apache.org/httpd/DirectoryListings).

## Related articles

* [Using .htaccess files](/docs/using-htaccess-files)

* [Default directory index page](/docs/default-directory-index-page)
