2017-04-05 99 views
0

新糾正控制器CI,所以它可能是安全的假設誤解......笨不是路由請求過去/index.php/

我的文件夾結構看起來像

. 
└── www 
    ├── appthing 
    │   └── V5 
    │    ├── application 
    │    │   ├── config 
    │    │   ├── controllers 
    │    │   │   ├── api 
    │    │   │   └── V1 
    │    │   │    ├── settings.php 
    │    │   ├── ... 
    │    │   └── views 
    │    └── system 
    └── vhosts 
     └── appthing 
       index.php 
       .htaccess 

htaccess

/etc/apache2/sites-available/000-default.conf中的我的apache配置看起來像:

DocumentRoot /var/www/www/vhosts/appthing 

<Directory "/var/www/www/vhosts/appthing"> 
    AllowOverride All 
</Directory> 

當我導航到ipaddress/index.php時,我得到一個驗證錯誤,這很好,因爲我至少可以訪問index.php文件。但是,如果我嘗試去index.php/settings,則會出現CI 404錯誤。相同的代碼適用於我的計算機(OS X,試圖將其放在AWS Ubuntu 16實例上),所以它不是CI語義的問題。

+0

config/routes中的默認控制器'$ route ['default_controller'] ='welcome';'將其更改爲您的控制器位置'/ api/controller_name/function_name_if_you_want_function_as_Default' –

回答

0

我認爲你需要將你的Documentroot設置爲/ var/www/www/appthing/V5。通常你應該在你的CI項目中有index.php文件,它將把你重定向到home(standard = welcome.php)控制器。