New account creation in cPanel is pretty hassle free. But, things go for a toss when the incorrect website page shows up.
Usually, the wrong page shows up due to wrong domain configuration in cPanel.
And, the website owners often contact us to fix their website as part of our Server Administration Services.
Today, we’ll see on how to change default index page in cPanel.
Default index page on new account
Before finding a fix for the problem, let’s have a quick look on how the default page shows up in a website.
In cPanel, upon new account creation, server automatically copies a set of files and folders from the skeleton folder to user’s home directory. This would also include a default index.html file in the public_html folder of the website. By default, this page shows up when you access the new website from a browser.
Usually, users upload contents to their website folder using FTP or cPanel’s File Manager. And, when the domain has incorrect settings, wrong index page shows up.
Reasons for showing wrong index page
In many cases, even after uploading the website content to the public_html folder of the website, wrong page shows up. Let’s take a look at the various reasons for this.
1. Wrong .htaccess entries
By default, the following rule set in the .htaccess file of the website controls the index page.
DirectoryIndex index.html index.php
The .htaccess file is normally read from left to right and select the first available page. For example, in this case, the web server will look for the index.html file, if it is missing, it will look for the index.php file etc.
However, when the newly designed page has a different name, say home.html, it would never show up as the default page.
2. Incorrect file name or path
Again, another reason for incorrect index page showing up on website happens when you forget to overwrite index.php or index.html file during file upload. As a result, the default index page still remains on website and that shows up.
The overwrite option in cPanel’s File Manager looks as shown:
Similarly, files in servers are case sensitive. If the index file has a name INdex.php, it do not match index.php file and results in wrong page too. From our experience in managing servers, our Dedicated Engineers often see customers uploading file to the wrong directory. This again causes default index page errors on the website.
3. Wrong IP address settings for domain
Often wrong IP address in the web server configuration also create problems with default index page. In such cases, domain’s DNS would take it to the correct server. But, inside Apache, it might be pointing to wrong IP. As a result, it will show the default cPanel index page.
How we set proper index page for website
We just saw the various reasons for the index page problem on the website. Now, let’s see how our Support Engineers fix it.
1. Verify domain IP
We begin investigation by checking whether the website resolves correctly to the server. Then, we confirm the IP address set in the Apache configuration file httpd.conf
In case of mismatch, we edit the configuration file and set it to the correct IP address.
2. Ensure index file exists
When the IP address settings are correct, we check the presence of index file in the document root of the website. For instance, in cPanel, it should be present in the public_html folder.
When users upload files to the sub folders, we copy the files to the correct folder. Additionally, we set the correct name for the index file, set proper permissions, etc.
3. Modify .htaccess
In some cases, we may need to modify the .htaccess file to point to the correct index file.
If the newly designed home page of the website is welcome.html, we set the public_html directory .htaccess entry as:
DirectoryIndex welcome.html
To edit the .htaccess, we either use the command line editor in SSH or cPanel’s File Manager. The edit page in File Manager looks as shown.
That fixes the problem and correct file shows up as the default index page of the website.
[Trouble seeing correct page on your website? We can make it working.]
Conclusion
In our vast server administration experience, wrong index page shows up due to many reasons like missing files, incorrect website settings, etc. Today, we saw the top reasons for index page errors and how to change default index page in cPanel.
thanks for help this article is also helpful