1.需要apache打开rewrite_module,然后修改httpd.conf的AllowOverride none 为AllowOverride All(里面,不同的环境目录不同)
2.在CI的目录下面创建.htaccess文件,加入如下内容:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\\.php|images|robots\\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
3.修改config.php的内容:$config[‘index_page‘] = ‘index.php‘;替换为$config[‘index_page‘] = ‘‘;
时间: 2024-10-15 12:08:51