简体   繁体   English

Codeigniter:无法加载索引功能

[英]Codeigniter : Index function cannot load

In my controller index() cannot load when controller name given in url 在我的控制器中,当url给出的控制器名称时,无法加载index()

for example (not load index function as given below): 例如(不提供如下所示的加载索引功能):

www.example.com/admin  //controller name

here the index() default load but I can't load it in my controller 这里的index()默认加载,但是我不能在控制器中加载

other wise (it works when given as below): 其他方面(按以下方式工作):

www.example.com/admin/index  //controller name/function name

Go to config/routs.php 转到config/routs.php

Change this 改变这个

$route['default_controller'] = 'admin';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

in addition 此外

Path - config/config.php 路径config/config.php

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

in your XAAMP Control Panel. 在您的XAAMP控制面板中。

Go to->Config->php.ini 转到->配置-> php.ini

Replace this 取代这个

allow_url_include=on

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM