Ci下面隐藏index.php的方法

Ci下面隐藏index.php的方法

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'] = '';

猜你喜欢

转载自blog.csdn.net/gkm84/article/details/80963282
今日推荐