duangangmo0583 2018-07-14 18:00
浏览 88

Apache无法识别隐藏的.index.php文件

I have a page that indexes the directory and outputs the files on an html table, in order for the table to look good I have to hide files that shouldn't be listed like php / js / css / favicon / htaccess files, everything is working properly until I hide my index.php and then my default page reverts to apache's disgusting default index page.

My .htaccess file

DirectoryIndex .index.php

My 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>

The whole page works fine as long as my index.php page isn't hidden with a dot, my css/js/favicon work fine hidden and work, just not .index.php. I have no idea what I'm doing wrong.

edit: if I go to https://example.com/.index.php the page loads fine but https://example.com is still the default apache index page

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 全一数分解素因子和素数循环节位数
    • ¥15 ffmpeg如何安装到虚拟环境
    • ¥188 寻找能做王者评分提取的
    • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
    • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
    • ¥15 写论文,需要数据支撑
    • ¥15 identifier of an instance of 类 was altered from xx to xx错误
    • ¥100 反编译微信小游戏求指导
    • ¥15 docker模式webrtc-streamer 无法播放公网rtsp
    • ¥15 学不会递归,理解不了汉诺塔参数变化