How To Change Default Index Page In .htaccess From cPanel

When you enter a URL on your web browser, the server looks for the first page of your website, also called index page. Usually, the default first page of a website are index.html, default.html, or index.php.

When you need a custom name for your index file or want to migrate your website from another and the index page has a custom name, you need to change the default index name.

This guide will teach you the process to change the default index page by making some changes in the .htaccess file using the cPanel.

Prerequisites

  • A Domain Name (example.com)
  • cPanel Credentials

Step 1

Login into your cPanel using your username and passwordHow To Change Default Index Page In .htaccess From cPanel

Step 2

Locate File Manager and Click on File Manager to access your website directory. You can also use a FTP Client to access it.

How To Change Default Index Page In .htaccess From cPanel

Step 3

Click on Settings from the top right corner to access the Settings menu. Select the Document Root and make sure Show Hidden files(dotfiles) is selected.

How To Change Default Index Page In .htaccess From cPanel

Click on Save button.How To Change Default Index Page In .htaccess From cPanel

Step 4

Open the .htaccess file located in the public_html directory.

How To Change Default Index Page In .htaccess From cPanel

Right-click the .htaccess file and Click on Edit. It will show up the Edit pop up. Click on Edit button.How To Change Default Index Page In .htaccess From cPanel

Step 5

Add the following line of code in your .htaccess file to configure your index page.

#Custom default index page
DirectoryIndex welcome.html

You can also add more than one file. The server will read the file from left to right. If the server doesn’t find the first one, it will look for another one in the right.

#Custom default index pages
DirectoryIndex welcome.html hello.htm welcome.html first.php

Click on Save Changes from the top right corner to save the new changes.

Conclusion

In this guide, you learned the process to change your default index page in a .htaccess file using the control panel.

Check out these top 3 cPanel hosting services:

HostArmada
$1.79 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
Ultahost
$2.03 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8

How To Redirect A Domain Without Changing The URL

This guide will teach you to to redirect your domain to a new address without ch
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Edit Your WordPress Website's .htaccess file Using cPanel

There are many files and folders present in the WordPress direc
4 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester

How to Edit the CSS for your WordPress Site Using the cPanel Hosting Control Panel

As you know, the design of a WordPress website is controlled by
4 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How to deactivate all your WordPress plugins at once from cPanel

While handling a WordPress website, you may encounter with many common WordP
4 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top