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; } }
以上就是ci如何去掉index.php(nginx)的详细内容,更多请关注php中文网其它相关文章!
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
上一篇:php格林威治时间转换成当前时间的方法
下一篇:php如何实现判断是不是手机访问