How to change the DirectoryIndex while using cPanel?
The article describes the steps to change the DirectoryIndex while using the cPanel control panel.
The Directory Index is an .htaccess code that specifies the default page
for your domain name. The .htaccess file is recursive - if you place it
in your main folder it will affect all subfolders which do not have
their own .htaccess file. If you wish to make an .htaccess file for an
addon or subdomain, you will need to place it into their document root
folder.
- In cPanel, navigate to the File Manager.
- Open your public_html folder and create a file named ".htaccess"
- Insert the code taken from below.
To make "index.jsp" your default page, enter this code:
If you wish to have your site look for alternative default pages if the first option isn't available, enter the following code.
DirectoryIndex home.html index.php index.shtml page1.php |
When a visitor loads your site, the site will first attempt to
serve up home.html. If it does not find home.html, it will look for
index.php. Failing that, it will look for index.shtml, and then
page1.php.
If you have any further questions, or need any assistance, please open a ticket with us.
Related Articles
How to solve the Directory Listing Denied in cPanel?
The article describes the steps to solve the Directory Listing Denied in cPanel. If your site is set to "No Indexing", you might get this error. This will cause a 403 error if you have no default index page. You can disable "No Indexing" in the Index ...
How to change your cPanel Password?
The article describes the steps to follow to change or reset your cPanel Password. Step 1: Log in to cPanel Step 2: Click “Password & Security” in the Preferences section. Step 3: You can change your password by filling in the fields and clicking ...
How to change file permissions through cPanel?
To change the file permissions when using the cPanel control panel, please follow the below steps, 1. Login to your cPanel account. 2. Select the File Manager option. 3. Select the file whose permissions you would like to change, and choose ...
How to change the upload_max_filesize variable while using cPanel?
The article guides you through the steps that need to be performed to change the upload_max_filesize variable while using cPanel control panel. If you have received an error such as "The uploaded file exceeds the upload_max_filesize directive in ...
How to delete a file using the File Manager while using cPanel?
The article describes the steps that you need to perform to delete a file using the File Manager when using cPanel control panel. In cPanel, find the "File Manager" in the Files section. Click the "Web Root" directory. Put a checkmark next to "Show ...