How To Set Index Page From cPanel Via .htaccess?

Sometimes you need to have a custom index or default page for your website. You can set the custom index page to your website by modifying the .htaccess file in your public_html folder or subdirectory. This article will assist you to set index page from cPanel.

Steps To Set Index Page From cPanel via htaccess File

  1. Login to your cPanel account.
  2. Under the Files section, click on the File Manager option.
    cpanel file manager
  3. Navigate to your website folder (public_html or subdirectory) and search for the .htaccess file. If the .htaccess file is not there in your directory then create it manually.

    Note: The .htaccess file will be in your public_html folder. By default, this file is hidden. To enable hidden files in cPanel, you can follow the steps provided in the article here.

  4. Right-click on the .htaccess file and select the Edit option to open this file in the editor mode.
    cpanel edit htaccess
  5. Add the following line at the top of this file and click on the Save Changes button to save the .htaccess file.
    DirectoryIndex FileName.html // Replace FileName.html with your actual index file name.
  6. For example, if you want to set the default.php file as the default page of your website then add the below line in the .htaccess file.
    DirectoryIndex default.php

If you enjoyed this tutorial, then you would love our support! All Kemuhost hosting plans include 24/7 support from our amazing support team. Check out our web hosting plans and have your website migrated for free today!

Add a Comment

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