|
1、apache的http.conf文件,找到mod_rewrite, 将#号去掉;
2、找到documentroot , 将 下面的AllowOverride none 改为 AllowOverride ALL
3、进入项目目录,在index.php的同级文件夹下新建.htaccess,内容为
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
4、进入项目的config的config.php文件,将$config['index_page'] = 'index.php' 改为 $config['index_page'] = '';
5、重启apache即可 |
|