---
title: "How to Change your Default Index Page in .htaccess"
description: "The server looks for specifically named files as the first page of your website, also known as the index page. The default order of index file names our particular servers look through is index.htm,..."
url: https://www.inmotionhosting.com/support/website/htaccess-change-index-page/
date: 2012-11-15
modified: 2021-08-16
author: "Scott Mitchell"
categories: ["Website"]
type: post
lang: en
---

# How to Change your Default Index Page in .htaccess

The server looks for specifically named files as the first page of your website, also known as the **index** page. The default order of index file names our particular servers look through is *index.htm*, *index.html*, *index.php*, and finally *default.htm*. You can **change** the name of the index file your account looks for by altering the **.htaccess** file. Perhaps you want to have a specific custom name for your index file or maybe you are migrating from another host and the index page is named differently. This way your internal links will not be broken by renaming the index file.

![How to Change Your Default Index Page in .htaccess](https://i.ytimg.com/vi_webp/DhvYY5jXQMs/maxresdefault.webp)

*Don’t have time to read the article on how to change your default index page in .htaccess? Watch our walk-through video. *

## What is an htaccess File?

The .*htaccess* file is a hidden text file within your hosting account that can be very powerful. It is designed so that you can modify it to change the behavior of your website that normally would take higher access beyond your account. It acts as a liaison between your domain and the server and can perform many functions.
[Learn more about htaccess](/support/website/htaccess-file/)

## Changing your Default Index File via htaccess

1. [Log into your cPanel](/support/edu/cpanel/how-to-log-into-cpanel/).
2. Find the **Files **category and click on the **File Manager** icon.[![cpanel](https://www.inmotionhosting.com/support/wp-content/uploads/2012/07/cpanel_lanternUpdatesMay17_cmPape_01.png)](/support/wp-content/uploads/2012/07/cpanel_lanternUpdatesMay17_cmPape_01.png)    
3. Click **Settings** at the top right corner.[![cpanel](https://www.inmotionhosting.com/support/wp-content/uploads/2012/11/cpanel_plfix_PL_fix_Selection_03.png)](/support/wp-content/uploads/2012/11/cpanel_plfix_PL_fix_Selection_03.png)    
4. Select the document root for the domain you are working with and be sure the checkbox next to **Show Hidden Files** is checked. Click the **Save** button.[![file-manager-show-hidden](https://www.inmotionhosting.com/support/wp-content/uploads/2012/11/cpanel_plfix_PL_fix_Selection_05.png)](/support/wp-content/uploads/2012/11/cpanel_plfix_PL_fix_Selection_05.png)    
5. Look for the *.htaccess* file and right click on it. This brings up a menu. Find and click on the **Edit** option.[![file-manager-htaccess](https://www.inmotionhosting.com/support/wp-content/uploads/2012/07/cpanel_plfix_PL_fix_Selection_04.png)](/support/wp-content/uploads/2012/07/cpanel_plfix_PL_fix_Selection_04.png)    
6. You may be presented with a popup. Click on the **Edit** button. [![file-manager-htaccess](https://www.inmotionhosting.com/support/wp-content/uploads/2012/11/cpanel_plfix_click-edit.png)](/support/wp-content/uploads/2012/11/cpanel_plfix_click-edit.png)  
7. You are now in the htaccess editor. Paste the following code at the top of the page to configure your desired index page. In our example below, we decided to make the index page of our folders named first.html. #Alternate default index page DirectoryIndex first.html You can also list more than one file in the configuration. The file will be read left to right and check for them in that order. In this example, we add index.htm, index.html, and index.php to the list. First the server will check for first.html, if it does not find a file with that name, it continues to index.htm and so on. #Alternate default index pages DirectoryIndex first.html index.htm index.html index.php
8. Be sure to hit the **Save Changes** button in the upper right corner to save your new htaccess configuration.
