apache не возвращает index.php по умолчанию
Недавно я сделал каплю DigitalOcean с предустановленной LAMP. Пошел и загрузил мой сайт (включая index.php) в / var / www
Apache просто возвращает это работает! страница, я должен вручную добавить /index.php к моему URL
Вещи, которые я пробовал:
- Сделал файл.htaccess, содержащий "DirectoryIndex index.php"
- Добавление
DirectoryIndex index.php
к apache2.conf - Сначала установите index.php в dir.conf
- Создание index.html тоже не показывало.
РЕДАКТИРОВАТЬ: вот мой файл apache2.conf: http://pastebin.com/BMgiNdiD
1 ответ
Решение
Вам не хватает следующей конфигурации:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html \
default.htm home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>