Changing the default index file in VestaCP hosting

July 3, 2015   /   by Marco  / Categories :  Technology
DirectoryIndex index.html index.php

I had to launch a new website and needed to display the index.html file instead of the default index.php file.

The index.html file is use as a coming soon page whereas the index.php is part of the Content Management System. In order to resolve this issue I had to use these steps:

NOTE: I use CentOS with nginx so these steps may be different for you

1. Locate your httpd.conf file. In my case it was located in /home/admin/conf/web

2. Open the httpd.conf file and go to the section that has VirtualHost and find the relevant website address. eg if your website is businesslegions.com then go to that section.

Example:

<VirtualHost 10.10.10.10:8080>
 
ServerName businesslegions.com
ServerAlias www.businesslegions.com
ServerAdmin info@businesslegions.com
DocumentRoot /home/admin/web/businesslegions.com/public_html
ScriptAlias /cgi-bin/ /home/admin/web/businesslegions.com/cgi-bin/
Alias /vstats/ /home/admin/web/businesslegions.com/stats/
Alias /error/ /home/admin/web/businesslegions.com/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/httpd/domains/businesslegions.com.bytes bytes
CustomLog /var/log/httpd/domains/businesslegions.com.log combined
ErrorLog /var/log/httpd/domains/businesslegions.com.error.log
<Directory /home/admin/web/businesslegions.com/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
</Directory>
<Directory /home/admin/web/businesslegions.com/stats>
AllowOverride All
</Directory>

3. What you need to do now is add the following line:

DirectoryIndex index.html index.php

4. This makes the webserver display index.html first before index.php. So the final configuration should look like this:

DirectoryIndex index.html index.php

FEEDBACK
I hope this has helped some of you. If you need any further help then please let me know.
DO YOU LIKE WHAT YOU'VE READ?
Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!

Our Sponsors

  • Follow us:

OTHER ARTICLES YOU MAY LIKE


WHEN TO HIRE YOUR FIRST EMPLOYEE (AND WHEN NOT TO)

WHEN TO HIRE YOUR FIRST EMPLOYEE (AND WHEN NOT TO)

For many entrepreneurs, hiring the first employee is a major milestone. It represents growth, momentum, and the possibility that your business is evolving from a solo operation into something larger. At the same time, it can feel intimidating. Bringing someone onto your team introduces new responsibilities, financial commitments, and operational challenges. The decision to hire […]

read more
USE THESE TOOLS TO BUILD YOUR BUSINESS

USE THESE TOOLS TO BUILD YOUR BUSINESS

Building a business has never been short on ambition, but it has often been short on time, budget, and operational headroom. Founders are expected to market like a media team, sell like a seasoned closer, support customers around the clock, manage projects with precision, and still find space to think strategically. That is exactly why […]

read more

Like our Page