0
新糾正控制器CI,所以它可能是安全的假設誤解......笨不是路由請求過去/index.php/
我的文件夾結構看起來像
.
└── www
├── appthing
│ └── V5
│ ├── application
│ │ ├── config
│ │ ├── controllers
│ │ │ ├── api
│ │ │ └── V1
│ │ │ ├── settings.php
│ │ ├── ...
│ │ └── views
│ └── system
└── vhosts
└── appthing
index.php
.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語義的問題。
config/routes中的默認控制器'$ route ['default_controller'] ='welcome';'將其更改爲您的控制器位置'/ api/controller_name/function_name_if_you_want_function_as_Default' –