Skip to content

Commit 0e97c6b

Browse files
committed
Merge pull request #43 from infosiftr/just-php
Make the root more obvious, fix DirectoryIndex to php first
2 parents 97c1d90 + c06a648 commit 0e97c6b

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

5.4/apache/apache2.conf

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Listen 80
3636
Require all granted
3737
</Directory>
3838

39+
DocumentRoot /var/www/html
40+
3941
AccessFileName .htaccess
4042
<FilesMatch "^\.ht">
4143
Require all denied
@@ -52,6 +54,9 @@ CustomLog /proc/self/fd/1 combined
5254
<FilesMatch \.php$>
5355
SetHandler application/x-httpd-php
5456
</FilesMatch>
55-
DirectoryIndex index.php
5657

57-
DocumentRoot /var/www/html
58+
# Multiple DirectoryIndex directives within the same context will add
59+
# to the list of resources to look for rather than replace
60+
# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
61+
DirectoryIndex disabled
62+
DirectoryIndex index.php index.html

5.5/apache/apache2.conf

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Listen 80
3636
Require all granted
3737
</Directory>
3838

39+
DocumentRoot /var/www/html
40+
3941
AccessFileName .htaccess
4042
<FilesMatch "^\.ht">
4143
Require all denied
@@ -52,6 +54,9 @@ CustomLog /proc/self/fd/1 combined
5254
<FilesMatch \.php$>
5355
SetHandler application/x-httpd-php
5456
</FilesMatch>
55-
DirectoryIndex index.php
5657

57-
DocumentRoot /var/www/html
58+
# Multiple DirectoryIndex directives within the same context will add
59+
# to the list of resources to look for rather than replace
60+
# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
61+
DirectoryIndex disabled
62+
DirectoryIndex index.php index.html

5.6/apache/apache2.conf

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Listen 80
3636
Require all granted
3737
</Directory>
3838

39+
DocumentRoot /var/www/html
40+
3941
AccessFileName .htaccess
4042
<FilesMatch "^\.ht">
4143
Require all denied
@@ -52,6 +54,9 @@ CustomLog /proc/self/fd/1 combined
5254
<FilesMatch \.php$>
5355
SetHandler application/x-httpd-php
5456
</FilesMatch>
55-
DirectoryIndex index.php
5657

57-
DocumentRoot /var/www/html
58+
# Multiple DirectoryIndex directives within the same context will add
59+
# to the list of resources to look for rather than replace
60+
# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
61+
DirectoryIndex disabled
62+
DirectoryIndex index.php index.html

apache2.conf

+7-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Listen 80
3636
Require all granted
3737
</Directory>
3838

39+
DocumentRoot /var/www/html
40+
3941
AccessFileName .htaccess
4042
<FilesMatch "^\.ht">
4143
Require all denied
@@ -52,6 +54,9 @@ CustomLog /proc/self/fd/1 combined
5254
<FilesMatch \.php$>
5355
SetHandler application/x-httpd-php
5456
</FilesMatch>
55-
DirectoryIndex index.php
5657

57-
DocumentRoot /var/www/html
58+
# Multiple DirectoryIndex directives within the same context will add
59+
# to the list of resources to look for rather than replace
60+
# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
61+
DirectoryIndex disabled
62+
DirectoryIndex index.php index.html

0 commit comments

Comments
 (0)