View all Products Close Menu Menu
How can I change the file a web page loads from?
Updated Wednesday August 19th 2020 / Category Web Hosting

PLEASE NOTE: This method is for advanced users. If you’re unfamiliar with modifying your website’s .htaccess file it is best to seek advice from a professional web designer.

Why would I want to change the index on a page of my website?

By default, most web hosting servers (and certainly ours) will use index.php or index.html as the index page – the page that loads in your web browser when a URL is visited.
You might seek to change this to temporarily  display a “maintenance” page while you work on the website, or perhaps you’d rather keep the file name of your site’s code a certain format.

Here’s how you can change that!

  1. Navigate to the .htaccess file for the directory you’re working in. You can do this via cPanel’s File Manager or using FTP.
  2. Edit the .htaccess file to include the following code at the top:
    DirectoryIndex newfile.php
    Be sure to replace newfile.php to the name of the file that you wish to change your index page to. Make sure this file is in the same directory you’re working in!
  3. Save the changes you’ve made.

That’s it! Now the page you’re working on will load from your nominated file.

Can’t find the answers you're looking for? Check out these other methods of support!