首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >apache不返回默认的index.php

问apache不返回默认的index.php
EN

Stack Overflow用户
提问于 2014-01-27 18:42:08
回答 1查看 2.6K关注 0票数 0

我最近做了一个DigitalOcean液滴灯预装.把我的网站(包括index.php)上传到/var/www

Apache只会返回它的工作原理!页面,我必须手动将/index.php添加到我的url中。

我尝试过的事情:

  1. 生成一个包含"DirectoryIndex index.php“的DirectoryIndex文件
  2. 将DirectoryIndex index.php添加到apache2.conf
  3. 在index.php中设置dir.conf优先
  4. 制作一个index.html,也没有显示出这一点。

编辑:这是我的apache2.conf文件:http://pastebin.com/BMgiNdiD

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-27 19:00:24

您缺少以下配置:

代码语言:javascript
复制
#
# 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>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21388978

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档