The “Index of /” error on websites happens when the browser can’t find the main page of a website. When you type a website’s address into your browser, it expects to find a specific file that acts as the homepage. This file is usually called the index file and is located in the website’s root folder. If this file is missing or named incorrectly, the browser shows the “Index of /” error instead.
This article will guide you through the steps to fix the “Index of /” error on your website.
How to Remove the “Index of /” Error from Your Website
Follow the steps below to troubleshoot the “index of /” error showing on your website.
Important: Before you do anything, we suggest you back up your website so you can revert it to a previous version in case something goes wrong.
Access Your File Manager
There are 2 ways to access the file manager.
Via Hosting Tab
- Log in to your Bluehost Account Manager.
- Click Hosting in the left-hand menu.
The details of your hosting plan will be displayed.
- In the hosting details page, click the CPANEL button.
- Your cPanel will open in a new tab.
- Click File Manager under the Files section.
Via the Websites Tab
- Log in to your Bluehost Account Manager.
- Click Hosting in the left-hand menu.
The details of your hosting plan will be displayed.
- Click Files & Access from the horizontal menu.
- Look for the File Manager, then click Manage.
Editing Your .htaccess File
Once inside the Manager, please follow the steps below.
- Look for the Settings button located towards the upper right corner of your screen.
- The Preferences pop-up will show. Click the Show Hidden Files (dotfiles) checkbox.
- Scroll to find the .htaccess file from the list.
- Right-click on the file, then click Edit from the menu.
- A dialogue box may ask you about encoding; click the Edit button to continue. This will open the Editor.
- Enter the script below into your .htaccess file to disable directory listing, and click Save Changes.
Options -Indexes
- Test your website to make sure it is already working. If the script above does not work, replace it with the new script below. Click Save Changes.
# disable directory browsing
Options ExecCGI Includes IncludesNOEXEC SymLinksIfOwnerMatch -Indexes
# enable directory browsing
Options All +Indexes
Checking Your Index File
Another way to resolve the issue is to check your index file. Access cPanel, then the File Manager by following the instructions above. Check your public_html folder to see if your index files are spelled correctly (for example, index.php, index.htm, or index.html). If you do not see these files in your root folder, create an empty file using the index file names mentioned (for example, upload index.html). For step-by-step instructions on creating files in the File Manager, check out File Manager – How to Create, Remove, and Edit Files.
Summary
The “Index of /” error occurs when no index file exists in your website directory or root folder. To fix this error, you can edit your .htaccess file by disabling the directory listing or checking your index file. To edit your .htaccess file, go to cPanel and access your File Manager to find the .htaccess file. Then, add the “Options -Indexes” command to your file to turn off the directory listing. Alternatively, you can check your index file. If you do not see these files in your root folder, create an empty file using the index file names index.php, index.htm, or index.html.
Write A Comment