How to use the Index Manager in cPanel
This demo assumes you’ve already logged in to cPanel
Now let’s learn how to use the Index Manager
1) Click the Index Manager icon
2) Choose the directory you want to start with, then click Go
The Index Manager enables you to control how directories on your website are displayed.
If there is no index.html file in a given directory, the contents of that directory will be displayed in a browser. This is typically undesireable, and can cause security issues. With Index Manager, you can set your account up to not allow your directory contents to be shown.
Let’s setup Index Manager for the clients directory
There are 4 settings to choose from: Default System Setting – allows the directory contents to be shown, No Indexing – does not allow directory contents to be shown, Standard Indexing (filename only) – Prevents browsers from viewing the contents of directories that do not contain image files, Fancying Indexing – Prevents browsers from viewing the contents of directories that do contain image files
3) Since we do not want the contents of this directory shown, choose No Indexing
4) Then click Save
That’s it! The Index settings have been updated, and visitors can no longer view the contents of the clients directory
5) Now let’s change the setting back to default, thus allowing visitors to view the contents of this directory
The Index Manager in cPanel is a useful tool that allows you to control how directories on your website are displayed to visitors. If a directory on your website does not contain an index.html
or index.php
file, the server will display a list of the files within that directory by default. This behavior is sometimes undesirable for privacy or navigational reasons. Using the Index Manager, you can decide whether to allow directory listings or to show a custom page or a 403 Forbidden error instead.
Here’s a step-by-step guide on how to use the Index Manager in cPanel to control the appearance of your directories:
Step 1: Accessing the Index Manager
- Log into cPanel: Start by logging into your cPanel account. This can usually be done by navigating to your website’s URL followed by
/cpanel
(e.g.,http://yourdomain.com/cpanel
) and entering your login credentials. - Find the Index Manager: Once logged in, look for the “Index Manager” in the cPanel dashboard. It is often located under the “Advanced” section, but you can also use the search feature at the top of the page to find it quickly.
Step 2: Selecting a Directory
- Navigate Through Directories: After opening the Index Manager, you will see a list of directories in your account. Navigate through the directories by clicking on the folder icons or names until you find the directory you want to manage. You can configure the Index Manager settings for your website’s root directory (public_html) or any subdirectory.
- Choose the Directory: Click on the name of the directory for which you want to change the index settings. If you want to apply settings to the entire website, choose the public_html directory.
Step 3: Choosing the Indexing Type
After selecting a directory, you will be prompted to choose how you want the directory to be displayed. You will typically have the following options:
- Default System Setting: Leaves the directory’s behavior as configured by the server administrator. This usually allows directory listings if there is no index file present.
- No Indexing: Prevents the server from listing the contents of the directory. Visitors attempting to access the directory directly will receive a 403 Forbidden error or a blank page, depending on the server configuration.
- Standard Indexing (filename only): Shows a simple, unstyled list of the files within the directory, displaying only their names.
- Fancy Indexing (filename and description): Shows a more detailed listing of the directory contents, including file names, sizes, and modification dates.
Step 4: Saving Your Changes
- Select Your Preference: Click on the radio button next to the option that suits your needs best.
- Save the Configuration: Look for the “Save” button (the exact wording may vary) and click on it to apply your chosen settings to the directory. A confirmation message should appear, indicating that the changes have been successfully made.
Step 5: Testing Your Configuration
- Visit the Directory: After configuring the Index Manager, visit the directory in your web browser to ensure that it behaves as expected. If it doesn’t, double-check your settings in the Index Manager.
Additional Tips
- Use
.htaccess
for More Control: For more advanced control over directory listings and other server behaviors, you can use the.htaccess
file. This allows for custom error pages, redirects, and more. - Consider SEO and Security: Disabling directory indexing can be beneficial for both security and SEO, as it prevents visitors and search engines from viewing potentially sensitive files.
- Check Subdirectories: Remember, changing the setting for a parent directory does not automatically apply to its subdirectories. You’ll need to configure those separately if needed.
Using the Index Manager in cPanel allows you to have greater control over how the contents of your website’s directories are presented to visitors, enhancing both security and user experience.