February 18

Change Default Home Page From index.html

If your web host is running Apache – usually Linux based servers do, did you know that index.html or index.php does NOT have to be the homepage or the default landing page within a folder? You can actually have a page named prelaunch.html or prelaunch.php the type of file doesn’t matter and make that page the homepage.

This is great in some cases like before launch of a product, you want to use a temporary home page and switch it to index.html after launch. Here’s what you need to do.

Launch a text editor like PsPad and open up the .htaccess file in /public_html or inside the folder you want to change the default landing page in. If there is no .htaccess file, you may have to create it. You can even do this via cPanel’s File Manager.

Inside the .htaccess file, copy and paste the following code

DirectoryIndex index.html

Change index.php, .html, .htm etc to the name of your file, e.g. prelaunch.html so your final code, assuming your new homepage is prelaunch.html, will be

DirectoryIndex prelaunch.html

Tags


You may also like

Force cPanel Password Reset

Force cPanel Password Reset
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Get in touch

Name*
Email*
Message
0 of 350