Hack Forums
cant change Default Index.html - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: cant change Default Index.html (/showthread.php?tid=5539115)



cant change Default Index.html - Warrioя - Jan 31, 2017

Hello everyone,
I have Lamp installed on a VPS,
I want to change the default index.html to index.php but no success.
Here is my Default.conf setting for Apache2
Code
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mysite.com
ServerAlias http://www.mysite.com
DocumentRoot /var/www/domains/mysite.com
DirectoryIndex index.php
CustomLog /var/www/logs/mysite.com.log combined
ErrorLog /var/www/error_logs/mysite.com.log
<Directory /var/www/domains/mysite.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

I also tried to redirect index.html to index.php via .htaacc via 301 redirect

Code
redirect 301 /index.html http://www.mysite/index.php
but it has no effect.

can you guys tell me what is forcing Apache to load index.html ?


* - AshleyUK - Jan 31, 2017

(Jan 31, 2017 09:58 AM)Warrioя Wrote:  Hello everyone,
I have Lamp installed on a VPS,
I want to change the default index.html to index.php but no success.
Here is my Default.conf setting for Apache2
Code
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mysite.com
ServerAlias http://www.mysite.com
DocumentRoot /var/www/domains/mysite.com
DirectoryIndex index.php
CustomLog /var/www/logs/mysite.com.log combined
ErrorLog /var/www/error_logs/mysite.com.log
<Directory /var/www/domains/mysite.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

I also tried to redirect index.html to index.php via .htaacc via 301 redirect

Code
redirect 301 /index.html http://www.mysite/index.php
but it has no effect.

can you guys tell me what is forcing Apache to load index.html ?

Do
Code
sudo nano /etc/apache2/mods-enabled/dir.conf

and move index.php to before index.html


* - Warrioя - Jan 31, 2017

(Jan 31, 2017 01:30 PM)UGAshley Wrote:  Do
Code
sudo nano /etc/apache2/mods-enabled/dir.conf

and move index.php to before index.html

Already did that.. I removed the index.html from there.
There is only index.php.


still looking for help,
thank you guys


* - Rolex™ - Feb 1, 2017

Modify your 'httpd.conf' if you want to achieve this, I did a quick Google search and pulled a StackOverflow article.
http://image.prntscr.com/image/37c4dfe7b7f341d99b0e624e98e5794b.png