index.php文件默认情况下不加载 [英] index.php not loading by default

查看:272
本文介绍了index.php文件默认情况下不加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚安装了CentOS,Apache和PHP,当我访问我的网站 http://domain.com/myapp/ ,它说禁在默认情况下它不加载index.php文件。

当我访问 http://domain.com/myapp/index.php ,它工作正常。

不知道如何解决这个问题?


解决方案

Apache需要进行配置,以识别的index.php作为一个索引文件。

最简单的方法来完成这个..


  1. 创建Web根.htaccess文件。


  2. 添加行...



  

    

的DirectoryIndex index.php文件


  

下面是关于此事的资源......结果
<一href=\"http://www.twsc.biz/twsc_hosting_htaccess.php\">http://www.twsc.biz/twsc_hosting_htaccess.php

编辑:我假设的Apache配置为允许.htaccess文件。如果不是,你就必须修改设置Apache的配置文件(httpd.conf)

I have just installed centos, apache and php when I visit my site http://domain.com/myapp/, it says "forbidden" by default its not loading the index.php file.

When I visit http://domain.com/myapp/index.php, it works fine.

Any idea how to fix that issue ?

解决方案

Apache needs to be configured to recognize index.php as an index file.

The simplest way to accomplish this..

  1. Create a .htaccess file in your web root.

  2. Add the line...

DirectoryIndex index.php

Here is a resource regarding the matter...
http://www.twsc.biz/twsc_hosting_htaccess.php

Edit: I'm assuming apache is configured to allow .htaccess files. If it isn't, you'll have to modify the setting in apache's configuration file (httpd.conf)

这篇关于index.php文件默认情况下不加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆