How to Change Your Default Index File Print

  • 0

Changing your default index file via htaccess

First, you will need to log into your cPanel to access the htaccess file.
    
Find the Files category and click on the File Manager icon.
    
A popup box will appear. For the primary domain, click on the Web Root radio button. For addon domains, click on the dropdown and find your desired addon domain name. Be sure the checkbox next to Show Hidden Files is checked. Click the Go button to enter the File Manager.
    
You should now be in the root folder of the domain you chose. Look for the .htaccess file and right click on it. This brings up a menu. Find and click on the Edit option. If you get a popup box, simply find and click the Edit button in the lower right corner to continue to the editor.
    
You are now in the htaccess editor. Paste the following code at the top of the page to configure your desired index page. In the example below the default index page is set to first.html.
    
#Alternate default index page
DirectoryIndex first.html
    
You can also list more than one file in the configuration. The file list will be read from left to right and checked in that order.
    
#Alternate default index pages
DirectoryIndex first.html index.htm index.html index.php
   
Be sure to hit the Save Changes button in the upper right corner to save your new htaccess configuration.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution