A few days ago, I encountered a certain problem and it took me a while before finally solving it. Well, on this specific website I had modified the front page in the .htaccess file to feature a static web page rather than the default webpage.
I’m sure you would agree with me, how some simple templates look beautiful and you can’t resist using them.
- The homepage loads fast
- Your visitors won’t have to wait for long for the webpage to load
- You can use a unique front webpage
This is what drove me to use the static page in creating the homepage of the website. Having been an issue to me, I realized it might be the same for some of you too. I was changing the index page and no changes were showing and it took me a while before I finally resolved.
In this article we will discuss two things:
- How to change your default index page in .htaccess in the Cpanel
- My changes in Cpanel are not showing on my website
How to change your default index page in htaccess file
You may have used a content management system like Joomla, WordPress, or an eCommerce platform to make your website. However, you may prefer having a unique page as the homepage to make it load faster.
The available template’s homepage may not favor you and you may decide to choose another with more features. The first page of the website is normally the index page.
Steps to take to change your default indexpage in htaccess file.
- Login to your Cpanel account and access the file manager and access your website directory.
2) If the .htaccess file is not visible, click settings and select the document root and check to show the hidden files. Select the .htaccess file and edit.
3) Thus, add this line of code to the file. It will change the index page and you can put your favorite. Preferrable, add the code at the top of the page and you may add some comments for you to remember this change.
#Custom default index page
(or home.html or welcome.html, The specific page that you want.)
4) You can also add one or more files so that if it doesn’t read the first, it reads the second
#Custom default index page
DirectoryIndex welcome.html home.html index.php
Ensure you save the changes.
5) However, you need to have an already made the index page, so that when you reload the page, it overwrites the default homepage.
What to do if your website changes in Cpanel are not showing
Having already changed your homepage to load the index.html page through the .htacces, you might at some point want to modify it.
However, at times you may make changes and changes don’t show immediately. You can wait for a while and if it doesn’t change after some hours. Try these steps:
1) Clear your browser’s cache, if you use Chrome or Firefox for most of your internet operations. You can clear any of them or use a browser you rarely use.
Then try reloading your page. You can try on your laptop, computer, phone, or tablet.
2) Check your File manager in the Cpanel to see where you hosted the website. The domain you are using may be “example.com” and you see your files there, but when you modify, no changes occur! Don’t worry.
3) If that is the only website you have hosted in the CPanel, and then be sure that the main files are in the public.html file. Try changing the specific files from there.
4) Make all the necessary changes, save, and then reload your website. The main issue maybe that you are modifying the wrong page. That’s why it is important to have only one folder with your website files to ensure you don’t get into a mess while trying to change the content or code.
5) If your server has difficulty in supporting redirecting, you can add this line of code to the .htaccess file
RewriteRule ^(.*)index\.(php|html?)$ /$1 [R=301,NC,L]
I hope this will be helpful 🙂