例如将URL: http://www.example.com/index.php/show/index去掉入口index.php后http://www.example.com/show/index还可以继续访问,需要如下操作:
-
修改apache目录httpd.conf配置:打开
LoadModule rewrite_module libexec/apache2/mod_rewrite.so,将AllowOverride none为AllowOverride All,重启服务器sudo apachectl restart -
在CI的目录下面创建.htaccess文件,加入如下内容:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
- 修改config.php的内容:
$config['index_page'] = 'index.php';替换为$config['index_page'] = '';










网友评论