2012-04-23 54 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