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,068
Replies
7
Views
4,887
Replies
5
Views
2,950
Latest Threads
Replies
0
Views
58
Replies
0
Views
69
Replies
0
Views
75
Replies
2
Views
77
Recommended Threads
Replies
19
Views
7,134
Replies
4
Views
10,589
fwh
Replies
4
Views
1,025

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