Routes in Codeigniter - 404 Page Not Found

孤街醉人 提交于 2019-12-01 06:26:18

Judging the title, first of all check if your server is running PHP using CGI/FastCGI or not (you could simply check that by phpinfo()).

If so, change the following in config.php:

$config['uri_protocol'] = "REQUEST_URI";

Back to the topic, you could achieve that by using the single-line route below within your routes.php file:

$route['support/(?!index)(?!delete)(:any)'] = "support/viewticket/$1";

And remove these lines from your __construct method:

$urlarray = array("index","delete");
if(!in_array($this->uri->segment(2),$urlarray)){
    $this->viewticket($this->uri->segment(2));
}

Let me know how it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!