2012-04-23 64 views
1

我有一个index.php文件位置:的index.php不开放

http://localhost/widget_corp/explore/home/

但是当我键入此路径,然后按回车它做的index.php因此无法打开,如果我键入

http://localhost/widget_corp/explore/home/index.php

它打开!可能是什么问题?

编辑:我也有一个在这里index.php文件:

http://localhost/widget_corp/explore/staff/

,当我键入此路径,然后按回车它打开的index.php

然后用主目录什么问题?

+1

需要更多细节。你在运行什么操作系统?什么网络服务器软件? – ghoti 2012-04-23 12:01:00

+0

检查你的'home'文件夹是否没有'index.html'文件!! – Rikesh 2012-04-23 12:01:26

+0

我已经做了一些修改。退房 – yusufiqbalpk 2012-04-23 12:04:45

回答

0

您需要设置DirectoryIndex文件您的Web服务器的(我认为现在的Apache):

DirectoryIndex index.php 
httpd.conf

http://httpd.apache.org/docs/2.0/mod/mod_dir.html

+0

我在这里也有一个index.php文件: http:// localhost/widget_corp/explore/staff/ 当我输入这个路径并按回车键打开index.php 然后最新的主目录有问题吗? – yusufiqbalpk 2012-04-23 12:10:21

+0

Apache设置:DirectoryIndex index.php index.php3 index.html index.htm – yusufiqbalpk 2012-04-23 12:15:54

+0

该文件夹中是否有'.htaccess'文件? – binarious 2012-04-23 12:18:01

0

尝试添加下面一行到你的.htaccess文件:

DirectoryIndex index.php index.html 
+0

我这儿也有一个index.php文件: 的http://本地主机/ widget_corp /浏览/人员/ ,当我键入此路径,然后按回车它与主目录打开的index.php 然后什么问题? – yusufiqbalpk 2012-04-23 12:09:45

+0

这是我的目录索引在Apache'代码'DirectoryIndex index.php index.php3 index.html index.htm'code' – yusufiqbalpk 2012-04-23 12:13:15

+0

@yusufiqbalpk - 在您的主目录中是否有'.htaccess'文件?它是否包含“DirectoryIndex”设置? – 2012-04-23 12:22:19

0

如果你正在使用你需要设置的DirectoryIndex

+0

我也有一个索引。PHP文件在这里: 的http://本地主机/ widget_corp /浏览/人员/ ,当我键入此路径和它打开的index.php 然后用什么主目录中的问题,按回车键? – yusufiqbalpk 2012-04-23 12:09:11

0

阿帕奇看看你httpd.conf。应该有一个名为DirectoryIndex的行来控制这个。它应该是这样读取的:

DirectoryIndex index.html index.htm default.htm index.php index.pl 
+0

我这儿也有一个index.php文件: 的http://本地主机/ widget_corp /浏览/人员/ ,当我键入此路径,然后按回车它与主目录打开的index.php 然后什么问题? – yusufiqbalpk 2012-04-23 12:08:50

+0

Apache设置:DirectoryIndex index.php index.php3 index.html index.htm – yusufiqbalpk 2012-04-23 12:14:53

0

可能你在同一个路径中有一个文件名index.html。或者你没有目录索引。

+0

no index.html there @ home目录 – yusufiqbalpk 2012-04-23 12:08:22