Global Header
6 Mins Read

How to Fix the “Index of /” Error on a Website

Home Blog Hosting How to Fix the “Index of /” Error on a Website
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.

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

  1. Log in to your Bluehost Account Manager.
  2. Click Hosting in the left-hand menu.Bluehost Account Manager - Hosting Tab
     The details of your hosting plan will be displayed.Bluehost Account Manager - Hosting Tab Details
     
  3. In the hosting details page, click the CPANEL button.Bluehost Account Manager - Hosting Tab Details cPanel
     
  4. Your cPanel will open in a new tab.Bluehost Account Manager - Hosting Tab - Quick Links - cPanel button - cPanel Dashboard
     
  1. Click File Manager under the Files section.BH cPanel - File Manager

Via the Websites Tab

  1. Log in to your Bluehost Account Manager.
  2. Click Hosting in the left-hand menu.Bluehost Account Manager - Hosting Tab
     The details of your hosting plan will be displayed.Bluehost Account Manager - Hosting Tab Details
     
  1. Click Files & Access from the horizontal menu.BH AM - Websites - Tab - Files and Access
  2. Look for the File Manager, then click Manage.BH AM - Websites - Tab - Files and Access - File Manager

Editing Your .htaccess File

Once inside the Manager, please follow the steps below.

  1. Look for the Settings button located towards the upper right corner of your screen.BH cPanel - File manager - Settings
  2. The Preferences pop-up will show. Click the Show Hidden Files (dotfiles) checkbox.BH cPanel - File manager - .htaccess - Show Hidden
  3. Scroll to find the .htaccess file from the list.BH cPanel - File manager - .htaccess
  4. Right-click on the file, then click Edit from the menu.
  5. BH cPanel - File manager - .htaccess - Right Click - Edit
  6. A dialogue box may ask you about encoding; click the Edit button to continue. This will open the Editor.
  7. BH cPanel - File manager - .htaccess - Right Click - Edit - Dialogue Box - Edit
  8. Enter the script below into your .htaccess file to disable directory listing, and click Save Changes.
  9. Options -Indexes
  10. BH cPanel - .htaccess - Edit Options Indexes - Save
  11. 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.phpindex.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.phpindex.htm, or index.html.

  • I'm Sampreet, a seasoned technical writer with a passion for simplifying complex topics into a clear and engaging content. At times when I'm not crafting a piece of guide, you'll find me playing cricket/ football or exploring new destinations and reading autobiographies of influential personalities.

Learn more about Bluehost Editorial Guidelines
View All

Write A Comment

Your email address will not be published. Required fields are marked *

Longest running WordPress.org recommended host.

Get Up to 61% off on hosting for WordPress Websites and Stores.