【发布时间】:2017-01-02 20:04:16
【问题描述】:
我在 codeigniter 3 上遇到路由错误。
未找到 在此服务器上未找到请求的 URL /index.php。 Apache/2.4.7 (Ubuntu) 服务器
我做了什么。 我的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
同时设置AllowOverride ALL
我的控制器Test.php
class Test extends CI_Controller {
public function index(){
print_r('test');
die();
}
}
我的路线:$route['test/(:any)'] = 'test/$1';
并尝试通过 url 到达此页面:
http://localhost/codeigniter/test/index.php
http://localhost/codeigniter/test/
【问题讨论】:
标签: codeigniter-3