How to change your default Index page under Apache web server?

marcyslen

Member
Joined
Jul 9, 2016
Messages
48
Points
8
How do I display or change a default page other than index.html or index.php under Apache web server?
 

karlkoeller

New member
Registered
Joined
Jul 29, 2016
Messages
4
Points
0
How do I display or change a default page other than index.html or index.php under Apache web server?
I am using two methods to change Index page in public_html and any folders as wanted.

Method 1:
Open your Apache configuration file httpd.conf
Code:
nano httpd.conf
Find out line that read as follows:
Code:
DirectoryIndex
Now set it as per your requirements:
Code:
DirectoryIndex index.html index.htm default.htm index.php index.pl
Save and close the file.

Method 2:

Putting this code into .htaccess file

Code:
DirectoryIndex firstpage.html index.htm index.html index.php
I hope it helps will help you!
 

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
773
Points
63
I like the method #2, thanks @karlkoeller for sharing these tips!

But the method #1 can affect to all websites on the sever without configuring more on some specific websites/accounts.
 
Newer Threads
Replies
6
Views
4,356
Replies
7
Views
5,090
Replies
5
Views
3,095
Latest Threads
Replies
1
Views
21
Replies
0
Views
174
Replies
1
Views
37
Replies
2
Views
81

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top