Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Set the default index page for Apache

Answer:

To set a custom default index page for Apache, you would need to use the DirectoryIndex directive

E.g. set the default page to index.php

Add the following lines to the Apache configuration (httpd.conf)

DirectoryIndex index.php index.html

The meaning of above config: If index.php is found, use it as the default page, else, fall back to look for index.html.

Restart Apache to take effect

# apachectl -k graceful

  1. Remove default Debian/Ubuntu default Apache welcome page
  2. Remove default Fedora/RHEL/CentOS default Apache welcome page
  3. Turn off directory listing in Apache
  4. Set default charset in Apache
  5. Apache restart explained

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>