0

我的网站:

http://ibnight.com

尝试通过以下方式访问我网站中的活动时:

http://ibnight.com/1

我收到一个未找到的错误:

在此服务器上找不到请求的 URL /1。

仅当我使用 url 中的 index.php 访问它时才有效,例如:

http://ibnight.com/index.php/1

我的控制器是这样的:

class Events extends CI_Controller {

    public function __construct()
    {}

    public function index()
    {}

    public function event()
    {}

} 

我的路由:

$route['default_controller'] = 'events';
$route['(:num)'] = $route['default_controller'] . '/event/$1'; 

我的配置:

$config['index_page'] = '';

我的.htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L] 
4

2 回答 2

0
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
于 2013-03-09T06:23:19.903 回答
0

尝试这个 :

RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] 
于 2013-03-09T05:37:40.493 回答