Bluehost Web Hosting Help
This is a .htaccess code which allows you to specify the file which loads as your default page whenever anyone types your domain name.
Tired of seeing the index.html file when you go to http://example.com? Want to see home.html or Index.php instead? No problem!
What to do first.
- Login to cPanel and go to the File Manager (or use FTP instead).
- Navigate to your public_html folder and edit or create a file named .htaccess.
- Insert the code as described below.
Here is the code format.
This would cause filename.ext to be treated as your default page. You can also append other filenames to it. You may want to have each folder without filename.ext to use a different page name as the default page. That's no problem too.
DirectoryIndex home.html index.php index.shtml page1.php
Placing the above code in your .htaccess file will cause this to happen. When a user types in yoursite.com, your site will look for home.html in your root directory, find it, and load that page as the default page. If it does not find home.html, it will then look for index.php; if it finds that one, it will load it, if not, it will look for index.shtml and the whole process repeats until it finds a file it can use. The list of files is read from left to right.
The .htaccess file is recursive, meaning it affects all the subfolders that do not have their own .htaccess file.
Where do I put this code for an Addon or Subdomain?
Instead of creating and editing the .htaccess file inside public_html, do this inside the document root folder of your Addon or Subdomain name.
Recommended Help Content
Stopping Display of All files on Web page
How to Stop A Directory Index From Being Shown
Avoiding index html
How do I display my home page which is using a name other than index.html?
How to host the Primary Domain from a subfolder htaccess
How do I make a sub directory (or sub folder) act as the public_html for your main domain?
Related Help Content
What is the .htaccess file and where can I find more information?
What is the Index Manager? How do I use the Index Manager?
How to fix ExecCGI in .htaccess
How to run CGI scripts for Addon domains.
Redirects that do not work due to PHP variables
The redirection of www.yourdomain.com/default.html or index.html to http://www.yourdomain.com/index.php?act=whatever redirects it to http://www.yourdomain.com/index.php%3fact=whatever In other words,
500 Internal Server Error when trying to install something with MOJO Marketplace
500 Internal Server Error when installing via the MOJO Marketplace installer.
URL redirect rewrite using the htaccess file
How do I perform a URL redirect/rewrite using the .htaccess file?
Hotlink Protection Using mod_rewrite
Preventing bandwidth theft using the mod rewrite engine and .htaccess
Adding Handlers to change your PHP Version
This article will explain how to add a PHP handler to your .htaccess files. This is useful if you want to customize the version of PHP that runs your PHP files.