我有一个索引目录并在html表格上输出文件的页面,为了使表格看起来更好,我必须隐藏不应列出的文件,例如php / js / css / favicon / htaccess文件,一切工作正常,直到我隐藏index.php,然后我的默认页面恢复为apache令人讨厌的默认索引页面。
我的.htaccess文件
DirectoryIndex .index.php
我的000-default.conf
<VirtualHost (removed)>
ServerName (removed)
ServerAlias (removed)
ServerAdmin (removed)
DocumentRoot /var/www/html
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# Other directives here
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
只要我的index.php页面没有用点隐藏,整个页面就可以正常工作,而我的css / js / favicon可以很好地隐藏并工作,而.index.php则不能。我不知道我在做什么错。
编辑:如果我转到https://example.com/.index.php,该页面可以正常加载,但是https://example.com仍然是默认的Apache索引页面