Empty site shows a 403 error. Creating default.htm, index.html file or another relevant index file in the site document root will help resolve the error.
The error is caused because the site is missing an index. The index file is what is loaded when the site is visited. Since there is no index file, the site refuses to load anything.
403 Error due to Empty Directory
NOTE: Creating a default.htm, index.html file, or another relevant index file in the site document root will remove the error.
TIP: The error will show in the Apache Error Log under "Cannot serve directory" and "No matching DirectoryIndex".
IMPORTANT: Although adding a index file will allow the site to load, since it's the index file that is being loaded, it's advised to add content to the index file after creating it.
Using SSH
- SSH into the relevant server
- Navigate to the site's document root
cd $(docroot.py domain.com)
REPLACE: domain.com with the appropriate domain name. - Run the command
touch index.html
REPLACE: .html with the extension of the file you want to add, such as .html, .php, .htm) - This creates a file that the DirectoryIndexing can read from which will remove the 403 error
Using File Manager
- Log into cPanel
- Navigate to File Manager, located in the Files section
- Locate and Navigate to the site's document root
- Create a new file by clicking +File
- Name the file index.EXT with the appropriate extension under New File Name
REPLACE: .EXT with the proper filename extension.
EXAMPLE: index.html, index.php, default.htm - Click Create New File
Comments
0 comments
Article is closed for comments.