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
- Login to your cPanel account.
- Under the Files section, click on the File Manager option.
- 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.
- Right-click on the .htaccess file and select the Edit option to open this file in the editor mode.
- 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. - 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!