How to Fix the "Index of /" Error on a Website
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.
Editing Your .htaccess File
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.
- Log in to your Bluehost Account Manager.
- Click the Hosting tab on the left-hand side menu.
- Scroll down to click the CPANEL button under the Quick Links section.
- Under the Files section, click the File Manager icon.
- Look for the Settings button located towards the upper right corner of your screen.
- The Preferences pop-up will show. Click the checkbox for Show Hidden Files (dotfiles).
- 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 following command into your .htaccess file to disable directory listing:
Options -Indexes
- Once you have edited the file, click the Save Changes button.
- Test your website to make sure it is already working. If the command above does not work, replace it with the new command below:
# 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 on 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 on 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.
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.