Change default directory page

Most probably you have been wondering how the Webserver decides which page from your site
to use as a main/default page of your site.  There is a directive named DirectoryIndex
which takes care of this.

On most web servers there is a pre-defined set of file names which server a start page.
The most commonly used are: index.html, default.html, index.php, index.asp, etc.

The good news is that you can set your custom file to be a start page of your site using .htaccess.
For example the following line set home-page.html as a main page of your site:
DirectoryIndex home-page.html
The DirectoryIndex directive can accept more than one name:
DirectoryIndex home-page.html Home.html, index.html index.php index.cgi
So when a visitors goes to the first page to be loaded will be the
home-page.html if it cannot be found the server will look then for Home.html, index.htm,
etc until it finds a match.
  • 19 Users Found This Useful
Was this answer helpful?

Related Articles

Can you provide a custom package for me?

Yes, most definitely. Simply open up a helpdesk ticket in the Sales department or contact us...

Redirect URLs using .htaccess

Sometimes you need to redirect some URL and/or page on your site to another one.The feature is...

Force SSL/https using .htaccess and mod_rewrite

Sometimes you may need to make sure that the user is browsing your site over a secure...

Change PHP variables using .htaccess

If you need to change the way your PHP is working you can do that using .htaccess.Please, note...

Block Bad robots, spiders, crawlers and harvesters

There are lots of examples across the internet that use ModRewrite. We will provide such an...