Is this normal behaviour?
Yes. On a default Apache install, only index.html
is set as the DirectoryIndex (the default setting).
Either in the appropriate <VirtualHost>
container, or main server config you need to add a <Directory>
section that specifically targets the defined document root directory.
For example:
DocumentRoot /var/www/html
<Directory "/var/www/html">
# Allow public access to the site
Require all granted
# FollowSymLinks is required for mod_rewrite
# (Although this is actually the default server setting)
Options FollowSymLinks
# Allow mod_dir to serve index.php by default
DirectoryIndex index.php
# Give full access to htaccess (optional)
# Strictly speaking you only need "FileInfo" for mod_rewrite
# - Alternatively place all your htaccess directives here...
AllowOverride All
</Directory>
You will then need to restart Apache.
mod_dir also needs to be enabled, but this should be loaded by default.