How to change the default cPanel index page

How to change the default cPanel index page

Creating a new cPanel account is quite annoying. But everything goes wrong if the wrong page of the website appears.

Normally a bad page is displayed in cPanel due to a bad domain configuration.

And website owners often turn to us to repair their site as part of our server administration.

Today we are going to see how we can change the default index page in cPanel.

Standard index page on new account

Before we look for a solution to the problem, we first want to see how the default page appears on the website.

When a new account is created in cPanel, the server automatically copies a number of files and folders from the skeleton folder to the user’s home directory. This includes the standard index.html file in the public_html folder of the website. By default, this page is displayed when you open a new website with your browser.

Usually users upload the contents of a folder to their website using an FTP or cPanel file manager. And if the domain does not have the right settings, the wrong index page will appear.

Reasons for incorrect display of index page

In many cases the wrong page even appears after uploading the content from the website to the public_html folder. Let’s look at the different reasons for this.

1. Incorrect .htaccess accessInputs

The next line, defined in the .htaccess file of the website, checks the index page by default.

DirectoryIndex index.html index.php

The .htaccess file is normally read from left to right and selects the first available page. In this case, the web server searches for the index.html file, for example, if it is missing, it searches for the index.php file, and so on.

However, if a new page has a different name, for example home.html, it will never be displayed as the default page.

2. Wrong filename or path

Another reason why the index page is not displayed correctly on the website is that you forgot to overwrite the index.php or index.html file when downloading the file. This is why the default index page remains on the site and appears.

The transfer option in cPanel’s file manager looks like the figure below:

How to change the default cPanel index page

The files on the servers are also case sensitive. If the index file is named INdex.php, it does not match the index.php file and the wrong page is displayed. Because of our experience in server management, our specialized engineers often see clients download files to the wrong folder. This leads to errors in the default index page of the site.

3. Incorrect IP address settings for domain

Often an incorrect IP address in the web server configuration also causes problems with the default index page. In this case, the DNS domain moves them to the correct server. But in Apache, it can point to the wrong IP address. This will display the default cPanel index page.

How do I determine the right index page for?

We have just seen the different causes of the problem of the index page of the site. Now we want to see how our support engineers solve the problem.

1. IP domain verification

We start the investigation by checking the correctness of the website on the server. We then confirm the IP address set in the Apache configuration file httpd.conf.

In case of a failure, we change the configuration file and configure it to the correct IP address.

2. Check that the index file exists

If the IP address is configured correctly, we check if there is an index file in the main directory of the document. In cPanel, for example, it must be present in the public_html folder.

When users upload files to subfolders, we copy them to the appropriate folder. We also determine the correct name of the index file, define the correct authorizations, etc.

3. .htaccess change

In some cases, we need to modify the .htaccess file to point to the correct index file.

If the newly created homepage is welcome.html, we set the entry in the public_html directory to .htaccess as :

CatalogueIndex bienvenue.html

To edit the .htaccess, we use the command line editor in SSH or the cPanel file manager. The edit page in the file manager looks as shown in the figure.

How to change the default cPanel index page

This solves the problem and the correct file appears as the default index page for the website.

[Problems displaying the correct page on your website?] We can do it].

Conclusion

According to our extensive experience in server management, a bad index page appears for many reasons, such as lost files, wrong site settings, etc. Today we have seen the main reasons for errors on the index page and how to change the default index page in cPanel.how to change default index page in php,change index html to index php

More Stories
Cloud Series: Authorize anything with macaroons