index.php默认不加载 [英] index.php not loading by default

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

问题描述

我刚刚安装了CentOS,Apache和PHP。当我访问我的网站 http://example.com/myapp/ 时,它说禁止。



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



有任何想法如何解决这个问题吗?

解决方案

Apache需要配置为将index.php识别为索引文件。




  1. 在web根目录中创建一个.htaccess文件。 p>


  2. 添加行...






DirectoryIndex index.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://example.com/myapp/, it says "forbidden". By default it's not loading the index.php file.

When I visit http://example.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天全站免登陆