Allow Directory Index Listings Using .htaccess

If there is no index file (such as index.php or index.html) in a directory, you can configure the web server to display a list of files inside that directory.

Default Behavior on Cyberin Servers

By default, Cyberin hosting servers disable directory index listings for security reasons.

When a visitor accesses a directory URL like:

https://example.com/gallery/

The web server looks for a default index file.
If no index file is found, the server returns:

403 Forbidden

This behavior helps prevent sensitive files from being exposed to the public.

When Should You Enable Directory Listings?

In some situations, you may want visitors to be able to browse files in a directory, such as:

If you understand the security risks involved, directory listings can be enabled using the .htaccess file.

How to Enable Directory Index Listings

  1. Open or create a .htaccess file in the directory where you want listings enabled.

  2. Add the following line:

Options +Indexes

What This Does

To reduce security risks, place the .htaccess file only inside the specific directory where you want directory listings to be visible.

To enable directory listings for the entire website, add the directive to the .htaccess file located in:

public_html/

⚠️ Security Warning:
Enabling directory listings site-wide can expose sensitive files. Only do this if it is absolutely necessary.

How to Disable Directory Index Listings

Directory listings are disabled by default on Cyberin servers.
If they were enabled previously, you can disable them by adding or modifying the following line in the .htaccess file:

Options -Indexes

This restores the default secure behavior and prevents visitors from viewing directory contents.

Need Hosting You Can Trust?

Cyberin provides fast and secure web hosting with industry-standard security configurations.