2013-07-12 40 views
1

我在Netbeans 7.3.1中啓動了一個新的Codeigniter項目,並對我的文件結構進行了以下設置。Netbeans仍顯示根文件夾

我在項目屬性設置爲web根目錄指向public_html文本框內。我也有這個我的htaccess文件以及我已經從ci配置文件中刪除index.php。

我的問題是,當我去localhost/MyProject它仍然顯示腳文件夾,我不知道爲什麼。

有沒有人看到我在某個地方犯過的錯誤。

-root 
    -application 
    -system 
    -public_html 
     -assets 
     .htaccess 
     index.php 

Options -Indexes 
Options +FollowSymLinks 

RewriteEngine On 
RewriteBase/

#Removes access to the system folder by users. 
#Additionally this will allow you to create a System.php controller, 

RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ index.php?/$1 [L] 

#When your application folder isn't in the system folder 

RewriteCond %{REQUEST_URI} ^application.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

#Checks to see if the user is attempting to access a valid file, 
#such as an image or css document, if this isn't true it sends the 
#request to index.php 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L] 

# If we don't have mod_rewrite installed, all 404's 
# can be sent to index.php, and everything works as normal. 
# Submitted by: ElliotHaughin 

ErrorDocument 404 /index.php 
+1

我想你或Netbeans在項目設置階段會感到困惑,可能是在[運行配置](https://netbeans.org/kb/docs/php/project-setup.html#runConfiguration)設置的時候。它公開了它的項目目錄,這顯然不是應該發生的事情。 – fvu

+0

這可能是因爲我第一次做了這個項目,然後開始移動並製作新的文件夾。你是否說我需要修復這個問題的索引文件輸入框? – user2576961

+0

查看我鏈接到的運行配置頁面,它解釋了所有不同的選項。 – fvu

回答

1

開箱即用的Netbeans不附帶笨支持的,但可以很容易地通過安裝相應的插件來解決:

https://kenai.com/projects/nbphpci/pages/Home

由於一個笨項目的具體結構告訴Netbeans CodeIgniter項目只是另一個php項目將無法正常工作。

安裝此插件的詳細過程可以在their Wikihere上找到。用法解釋爲here

我認爲你將不得不重新啓動一個新項目,並在項目設置嚮導中正確地激活CodeIgniter支持,那應該是這樣。

+0

因爲這是一個很好的答案。出於某種原因,我認爲這不一定能解決我的問題。 – user2576961

+0

只是我的兩分錢,我不是非常熟悉NetBeans,但我是基於他添加的目錄結構,請注意,它不是您的常見CI佈局,無論是作爲應用程序還是sys看到的都在根公共html文件夾之外 – chris

+0

@chris我對NB非常熟悉,但與CI不太熟悉,我只能指出:1)OP似乎沒有安裝CI插件2)NB似乎對項目目錄佈局感到困惑。 public_html是,如果我通過NetBeans正確讀取OP的問題,通過組合1和2可能已經結束了「錯誤」的地方。這就是爲什麼我認爲安裝插件是一個好主意,重新啓動一個啓用了CI支持的新項目並查看會發生什麼。 – fvu