index.php文件默认情况下不加载 [英] index.php not loading by default
问题描述
我刚安装了CentOS,Apache和PHP,当我访问我的网站 http://domain.com/myapp/ ,它说禁在默认情况下它不加载index.php文件。
当我访问 http://domain.com/myapp/index.php ,它工作正常。
不知道如何解决这个问题?
Apache需要进行配置,以识别的index.php作为一个索引文件。
最简单的方法来完成这个..
-
创建Web根.htaccess文件。
-
添加行...
的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..
Create a .htaccess file in your web root.
Add the line...
DirectoryIndex index.php
Here is a resource regarding the matter...
http://www.twsc.biz/twsc_hosting_htaccess.phpEdit: 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屋!