How to set Default page for cPanel hosting account

Typically, the default page of a domain is refer to index.* file . As an example, the default page when browse to http://abc.com will be refer to http://abc.com/index.htm usually. Actually the default page can be set to other than index.* by using DirectoryIndex directive in .htaccess file.

By default, DirectoryIndex directive is set to:

DirectoryIndex index.html index.htm default.htm index.php index.php3 index.phtml index.php5 index.shtml mwindex.phtml

Apache will look for each of the above files, in order, and serve the first one it finds when a visitor requests just a directory. If the webserver finds no files in the current directory that match names in the DirectoryIndex directive, then a directory listing will be displayed to the browser, showing all files in the current directory or show as page as forbidden where directory listing was disabled.

If you want to change your own DirectoryIndex to either add a different filename, shorten the list, or change the order of the list, just create a file named .htaccess in the directory where you want this behavior to occur. Inside the .htaccess file, put a single line beginning with DirectoryIndex followed by the list of filenames that you want Apache to serve first when a directory has been requested, like so:

DirectoryIndex index.phtml start.html

The above directive must be all on a single line in the .htaccess file.

If you capitalize or change the case of any of your filenames, then they won't match if they are not capitalized the same way in the DirectoryIndex directive. "INDEX.HTML" is not the same as "index.html"

If you have capitalized any of the filenames of your webpages, then you either need to rename them all lowercase, or you should create your own custom DirectoryIndex directive as described above, using whatever filename capitalization you want.

 
  • 0 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?

Схожі статті

How to setup imap account in Microsoft Outlook 2016

How to setup IMAP email account in Microsoft Outlook 2016 :   1. Launch your Microsoft Outlook...

How to setup email account in Microsoft Outlook 2016

How to setup email account in Microsoft Outlook 2016 :   1. Launch your Microsoft Outlook 2016....

How to setup pop3 account in Microsoft Outlook 2016

How to setup POP3 email account in Microsoft Outlook 2016 :   1. Launch your Microsoft Outlook...

How to setup pop3 account with SSL in Microsoft Outlook 2016

How to setup POP3 email account with SSL in Microsoft Outlook 2016 :   1. Launch your Microsoft...

How to enable SSL encryption in your Microsoft Outlook and Outlook Express

How to enable SSL encryption in Microsoft Outlook    1. Launch your Microsoft Outlook2. Go to...