Home > Article > Backend Development > How to remove index.php in ci (nginx)
nginx下ci去掉“index.php”的方法:首先在根目录下新增“.htaccess”文件;然后修改“nginx.conf”配置文件内容为“ rewrite ^/(.*)$ /index.php/$1;”;最后保存修改即可。
推荐:《PHP视频教程》
CI框架去除index.php(Nginx)
在根目录新增.htaccess文件
<IfModule authz_core_module> Require all denied </IfModule> <IfModule !authz_core_module> Deny from all </IfModule>
修改nginx.conf(如果有vhost.conf文件,则修改此文件)配置文件
location / { index index.html index.htm index.php; #autoindex on; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1; } }
The above is the detailed content of How to remove index.php in ci (nginx). For more information, please follow other related articles on the PHP Chinese website!